Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hiifong committed Jan 14, 2025
1 parent 4072ca1 commit e69478b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/gitdiff/gitdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -1136,10 +1136,11 @@ func GetDiff(ctx context.Context, gitRepo *git.Repository, opts *DiffOptions, fi
} else {
actualBeforeCommitID := opts.BeforeCommitID
if len(actualBeforeCommitID) == 0 {
parentCommit, _ := commit.Parent(0)
if parentCommit != nil {
actualBeforeCommitID = parentCommit.ID.String()
parentCommit, err := commit.Parent(0)
if err != nil {
return nil, err
}
actualBeforeCommitID = parentCommit.ID.String()
}

cmdDiff.AddArguments("diff", "--src-prefix=\\a/", "--dst-prefix=\\b/", "-M").
Expand Down

0 comments on commit e69478b

Please sign in to comment.