Skip to content

Commit 5dbe6d2

Browse files
committed
ignore spurious error from git diff
1 parent 30f605e commit 5dbe6d2

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

main.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,9 @@ func getDiffs(ctx context.Context, config *lcr.Config, prNumber int) ([]*diff.Fi
206206

207207
mergeBaseSha := commitsComparison.GetMergeBaseCommit().GetSHA()
208208
rawDiff, err = exec.Command("git", "diff", "--find-renames", mergeBaseSha, headSha).CombinedOutput()
209-
if err != nil {
210-
fmt.Printf(`
211-
212-
err -> %v
213-
214-
215-
216-
`, err.Error())
209+
// git diff return exit status 1 if there is a diff, so that does
210+
// not indicate an error
211+
if err != nil && err.Error() != "exit status 1" {
217212
return nil, fmt.Errorf("failed to run git diff: %w", err)
218213
}
219214
}

0 commit comments

Comments
 (0)