Skip to content

Commit dfa4e58

Browse files
authored
Fix git 2.11 error when checking IsEmpty (again) (#27399)
Follow #27393 Sorry that I made a mistake in #27393. The `errbuf` is not empty when the err is `exit status 129`.
1 parent e709bc1 commit dfa4e58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/git/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (repo *Repository) IsEmpty() (bool, error) {
8686
Stdout: &output,
8787
Stderr: &errbuf,
8888
}); err != nil {
89-
if (err.Error() == "exit status 1" || err.Error() == "exit status 129") && strings.TrimSpace(errbuf.String()) == "" {
89+
if (err.Error() == "exit status 1" && strings.TrimSpace(errbuf.String()) == "") || err.Error() == "exit status 129" {
9090
// git 2.11 exits with 129 if the repo is empty
9191
return true, nil
9292
}

0 commit comments

Comments
 (0)