feat(repos): 添加订阅commit log 接口。
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ListLogsOption } from './models/list-logs.options';
|
||||
import { Pipeline } from './../pipelines/pipeline.entity';
|
||||
import { PipelineTask } from './../pipeline-tasks/pipeline-task.entity';
|
||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
@@ -47,14 +48,9 @@ export class ReposService {
|
||||
return git;
|
||||
}
|
||||
|
||||
async listLogs(dto: ListLogsArgs) {
|
||||
const project = await this.projectRepository.findOneOrFail({
|
||||
id: dto.projectId,
|
||||
});
|
||||
async listLogs({ project, branch }: ListLogsOption) {
|
||||
const git = await this.getGit(project);
|
||||
return await git.log(
|
||||
dto.branch ? ['--branches', dto.branch, '--'] : ['--all'],
|
||||
);
|
||||
return await git.log(branch ? ['--branches', branch, '--'] : ['--all']);
|
||||
}
|
||||
|
||||
async listBranches(dto: ListBranchesArgs) {
|
||||
|
Reference in New Issue
Block a user