Allow fallback to default config

pull/2879/head
David Disu 2 years ago
parent 74e0505070
commit 3554cad19b
  1. 8
      apps/remix-ide/src/app/files/dgitProvider.js

@ -50,6 +50,8 @@ class DGitProvider extends Plugin {
async getGitConfig () {
const workspace = await this.call('filePanel', 'getCurrentWorkspace')
if (!workspace) return
return {
fs: window.remixFileSystemCallback,
dir: addSlash(workspace.absolutePath)
@ -152,14 +154,16 @@ class DGitProvider extends Plugin {
}
async currentbranch (config) {
const cmd = config ? config : await this.getGitConfig()
const defaultConfig = await this.getGitConfig()
const cmd = config ? defaultConfig ? { ...defaultConfig, ...config } : config : defaultConfig
const name = await git.currentBranch(cmd)
return name
}
async branches (config) {
const cmd = config ? config : await this.getGitConfig()
const defaultConfig = await this.getGitConfig()
const cmd = config ? defaultConfig ? { ...defaultConfig, ...config } : config : defaultConfig
const remotes = await this.remotes(config)
let branches = []
branches = (await git.listBranches(cmd)).map((branch) => { return { remote: undefined, name: branch } })

Loading…
Cancel
Save