Skip to content

Commit

Permalink
Fix git 2.11 error when checking IsEmpty (again) (#27399)
Browse files Browse the repository at this point in the history
Follow  #27393

Sorry that I made a mistake in #27393. The `errbuf` is not empty when
the err is `exit status 129`.
  • Loading branch information
wxiaoguang authored Oct 2, 2023
1 parent e709bc1 commit dfa4e58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/git/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (repo *Repository) IsEmpty() (bool, error) {
Stdout: &output,
Stderr: &errbuf,
}); err != nil {
if (err.Error() == "exit status 1" || err.Error() == "exit status 129") && strings.TrimSpace(errbuf.String()) == "" {
if (err.Error() == "exit status 1" && strings.TrimSpace(errbuf.String()) == "") || err.Error() == "exit status 129" {
// git 2.11 exits with 129 if the repo is empty
return true, nil
}
Expand Down

0 comments on commit dfa4e58

Please sign in to comment.