Skip to content

Commit

Permalink
Always use --first-parent (if necessary) on getCommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1986 committed Feb 8, 2020
1 parent 2df1656 commit 22c4185
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/adapter/repository/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ export class Git implements IGitService {
}
@cache('IGitService')
public async getCommit(hash: string): Promise<LogEntry | undefined> {
const parentHashesArgs = this.gitArgsService.getCommitParentHashesArgs(hash);
const parentHashes = await this.exec(...parentHashesArgs);
const singleParent = parentHashes.trim().split(' ').filter(item => item.trim().length > 0).length === 1;
//const parentHashesArgs = this.gitArgsService.getCommitParentHashesArgs(hash);
//const parentHashes = await this.exec(...parentHashesArgs);
//const singleParent = parentHashes.trim().split(' ').filter(item => item.trim().length > 0).length === 1;

const commitArgs = this.gitArgsService.getCommitArgs(hash);
const nameStatusArgs = singleParent ? this.gitArgsService.getCommitNameStatusArgs(hash) : this.gitArgsService.getCommitNameStatusArgsForMerge(hash);
const nameStatusArgs = this.gitArgsService.getCommitNameStatusArgsForMerge(hash);

const gitRootPath = await this.getGitRoot();
const commitOutput = await this.exec(...commitArgs);
Expand Down

0 comments on commit 22c4185

Please sign in to comment.