fix(repos): 完善 commit log 订阅接口。
This commit is contained in:
@@ -40,7 +40,7 @@ export class ReposService {
|
||||
await mkdir(workspaceRoot, { recursive: true });
|
||||
});
|
||||
const git = gitP(workspaceRoot);
|
||||
if (!(await git.checkIsRepo())) {
|
||||
if (!(await git.checkIsRepo().catch(() => false))) {
|
||||
await git.init();
|
||||
await git.addRemote(DEFAULT_REMOTE_NAME, project.sshUrl);
|
||||
}
|
||||
@@ -50,7 +50,9 @@ export class ReposService {
|
||||
|
||||
async listLogs({ project, branch }: ListLogsOption) {
|
||||
const git = await this.getGit(project);
|
||||
return await git.log(branch ? ['--branches', branch, '--'] : ['--all']);
|
||||
return await git.log(
|
||||
branch ? ['--branches', `remotes/origin/${branch}`, '--'] : ['--all'],
|
||||
);
|
||||
}
|
||||
|
||||
async listBranches(dto: ListBranchesArgs) {
|
||||
|
Reference in New Issue
Block a user