mirror of
https://github.com/go-gitea/gitea
synced 2024-11-09 03:21:45 +01:00
parent
624c0ba920
commit
caef9f9503
1 changed files with 2 additions and 1 deletions
|
@ -86,7 +86,8 @@ func (repo *Repository) IsEmpty() (bool, error) {
|
||||||
Stdout: &output,
|
Stdout: &output,
|
||||||
Stderr: &errbuf,
|
Stderr: &errbuf,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
if err.Error() == "exit status 1" && errbuf.String() == "" {
|
if (err.Error() == "exit status 1" || err.Error() == "exit status 129") && strings.TrimSpace(errbuf.String()) == "" {
|
||||||
|
// git 2.11 exits with 129 if the repo is empty
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return true, fmt.Errorf("check empty: %w - %s", err, errbuf.String())
|
return true, fmt.Errorf("check empty: %w - %s", err, errbuf.String())
|
||||||
|
|
Loading…
Reference in a new issue