mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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`.
This commit is contained in:
		@@ -86,7 +86,7 @@ func (repo *Repository) IsEmpty() (bool, error) {
 | 
				
			|||||||
			Stdout: &output,
 | 
								Stdout: &output,
 | 
				
			||||||
			Stderr: &errbuf,
 | 
								Stderr: &errbuf,
 | 
				
			||||||
		}); err != nil {
 | 
							}); 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
 | 
								// git 2.11 exits with 129 if the repo is empty
 | 
				
			||||||
			return true, nil
 | 
								return true, nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user