Skip to content

Commit e69478b

Browse files
committed
Update
1 parent 4072ca1 commit e69478b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

services/gitdiff/gitdiff.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,10 +1136,11 @@ func GetDiff(ctx context.Context, gitRepo *git.Repository, opts *DiffOptions, fi
11361136
} else {
11371137
actualBeforeCommitID := opts.BeforeCommitID
11381138
if len(actualBeforeCommitID) == 0 {
1139-
parentCommit, _ := commit.Parent(0)
1140-
if parentCommit != nil {
1141-
actualBeforeCommitID = parentCommit.ID.String()
1139+
parentCommit, err := commit.Parent(0)
1140+
if err != nil {
1141+
return nil, err
11421142
}
1143+
actualBeforeCommitID = parentCommit.ID.String()
11431144
}
11441145

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

0 commit comments

Comments
 (0)