Merge pull request #4236 from ethereum/submodulecommit

Submodulecommit
add_template_0
yann300 12 months ago committed by GitHub
commit ee3b763534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      apps/remix-ide/src/app/files/dgitProvider.js
  2. 1
      apps/remix-ide/src/remixEngine.js

@ -362,6 +362,48 @@ class DGitProvider extends Plugin {
this.call('terminal', 'logHtml', `Cloning submodule ${dir}...`)
await git.clone(cmd)
this.call('terminal', 'logHtml', `Cloned successfully submodule ${dir}...`)
const commitHash = await git.resolveRef({
...await this.getGitConfig(currentDir),
ref: 'HEAD'
})
const result = await git.walk({
...await this.getGitConfig(currentDir),
trees: [git.TREE({ ref: commitHash })],
map: async function (filepath, [A]) {
if(filepath === module.path) {
return await A.oid()
}
}
})
if(result && result.length) {
this.call('terminal', 'logHtml', `Checking out submodule ${dir} to ${result[0]} in directory ${dir}`)
await git.fetch({
...await this.parseInput(input),
...await this.getGitConfig(dir),
singleBranch: true,
ref: result[0]
})
await git.checkout({
...await this.getGitConfig(dir),
ref: result[0]
})
const log = await git.log({
...await this.getGitConfig(dir),
})
if(log[0].oid !== result[0]) {
this.call('terminal', 'log', {
type: 'error',
value: `Could not checkout submodule to ${result[0]}`
})} else {
this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`)
}
}
await this.updateSubmodules({
...input,
dir
@ -371,6 +413,7 @@ class DGitProvider extends Plugin {
console.log(e)
}
}
setTimeout(async () => {
await this.call('fileManager', 'refresh')
}, 1000)

@ -21,6 +21,7 @@ export class RemixEngine extends Engine {
if (name === 'walletconnect') return { queueTimeout: 60000 * 4 }
if (name === 'udapp') return { queueTimeout: 60000 * 4 }
if (name === 'circuit-compiler') return { queueTimeout: 60000 * 4 }
if (name === 'filePanel') return { queueTimeout: 60000 * 20 }
return { queueTimeout: 10000 }
}

Loading…
Cancel
Save