File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -472,8 +472,11 @@ func AllowLFSFiltersArgs() TrustedCmdArgs {
472472// see: https://github.com/go-gitea/gitea/issues/32889#issuecomment-2571848216
473473// Should not add sapce in the end, sometimes git will add a `:`.
474474func IsRemoteNotExistError (err error ) bool {
475+ // for git < 2.30
475476 prefix := "exit status 128 - fatal: No such remote"
476- if DefaultFeatures ().NewExitStatusForRemoteNotExist {
477+
478+ // for git >= 2.30
479+ if DefaultFeatures ().CheckVersionAtLeast ("2.30" ) {
477480 prefix = "exit status 2 - error: No such remote"
478481 }
479482 return strings .HasPrefix (err .Error (), prefix )
Original file line number Diff line number Diff line change @@ -26,11 +26,10 @@ const RequiredVersion = "2.0.0" // the minimum Git version required
2626type Features struct {
2727 gitVersion * version.Version
2828
29- UsingGogit bool
30- SupportProcReceive bool // >= 2.29
31- SupportHashSha256 bool // >= 2.42, SHA-256 repositories no longer an ‘experimental curiosity’
32- SupportedObjectFormats []ObjectFormat // sha1, sha256
33- NewExitStatusForRemoteNotExist bool // >= 2.30
29+ UsingGogit bool
30+ SupportProcReceive bool // >= 2.29
31+ SupportHashSha256 bool // >= 2.42, SHA-256 repositories no longer an ‘experimental curiosity’
32+ SupportedObjectFormats []ObjectFormat // sha1, sha256
3433}
3534
3635var (
@@ -78,7 +77,6 @@ func loadGitVersionFeatures() (*Features, error) {
7877 if features .SupportHashSha256 {
7978 features .SupportedObjectFormats = append (features .SupportedObjectFormats , Sha256ObjectFormat )
8079 }
81- features .NewExitStatusForRemoteNotExist = features .CheckVersionAtLeast ("2.30" )
8280 return features , nil
8381}
8482
You can’t perform that action at this time.
0 commit comments