get the commits

pull/4236/head
filip mertens 1 year ago committed by yann300
parent 065123fc21
commit 538a9c8c23
  1. 58
      apps/remix-ide/src/app/files/dgitProvider.js
  2. 1
      apps/remix-ide/src/remixEngine.js

@ -217,22 +217,10 @@ class DGitProvider extends Plugin {
}
async lsfiles (cmd) {
console.log('lsfiles')
const filesInStaging = await git.listFiles({
...await this.getGitConfig(),
...cmd
})
console.log(await git.resolveRef({
...await this.getGitConfig(),
ref: 'HEAD'
}))
console.log(await git.readTree({
...await this.getGitConfig(),
oid: await git.resolveRef({
...await this.getGitConfig(),
ref: 'HEAD'
})
}))
return filesInStaging
}
@ -367,32 +355,46 @@ class DGitProvider extends Plugin {
const cmd = {
url: module.url,
singleBranch: true,
depth: 1,
depth: 5000, // this is needed because we need the history to find the commit hash
...await this.parseInput(input),
...await this.getGitConfig(dir)
}
this.call('terminal', 'logHtml', `Cloning submodule ${dir}...`)
await git.clone(cmd)
this.call('terminal', 'logHtml', `Cloned successfully submodule ${dir}...`)
console.log('checkout the commit of the submodule ', currentDir, module.path)
console.log(await git.readTree({
const commitHash = await git.resolveRef({
...await this.getGitConfig(currentDir),
oid: await git.resolveRef({
...await this.getGitConfig(currentDir),
ref: 'HEAD'
})
}))
ref: 'HEAD'
})
const treeWalker = new git.TreeWalker(await git.readTree({
const result = await git.walk({
...await this.getGitConfig(currentDir),
oid: await git.resolveRef({
...await this.getGitConfig(currentDir),
ref: 'HEAD'
})}))
trees: [git.TREE({ ref: commitHash })],
map: async function (filepath, [A]) {
//console.log(filepath, await A.oid())
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.getGitConfig(dir),
...await this.parseInput(input),
})
const status = await git.log({
...await this.getGitConfig(dir),
...cmd
})
console.log(treeWalker)
await git.checkout({
...await this.getGitConfig(dir),
ref: result[0]
})
this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`)
}
await this.updateSubmodules({
...input,

@ -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 * 10 }
return { queueTimeout: 10000 }
}

Loading…
Cancel
Save