fix(repos): 无法获取远程版本的问题。

This commit is contained in:
Ivan
2021-02-24 10:45:33 +08:00
parent 9470aa8f8a
commit 42c389b913
4 changed files with 12 additions and 28 deletions

View File

@@ -34,7 +34,6 @@ export class ReposService {
if (firstInit) {
await git.init();
await git.addRemote('origin', project.sshUrl);
// await git.clone(project.sshUrl, workspacePath);
}
return git;
}
@@ -44,13 +43,7 @@ export class ReposService {
id: dto.projectId,
});
const git = await this.getGit(project);
await git
.outputHandler((command, stdout, stderr) => {
stdout.pipe(process.stdout);
stderr.pipe(process.stderr);
})
.fetch();
// await git.checkoutBranch('master', 'origin/master');
await git.fetch();
return await git.log({
'--branches': dto.branch ?? '',
'--remotes': 'origin',