mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-06-19 23:00:02 +02:00
[PORT] Fix git error handling (gitea#32401)
--- Conflict resolution: Trivial, for `repo_attributes.go` move where the `IsErrCanceledOrKilled` needs to happen because of other changes that happened in this file. To add some words to this change: It seems to be mostly simplifying the error handling of git operations. (cherry picked from commit e524f63d58900557d7d57fc3bcd19d9facc8b8ee)
This commit is contained in:
parent
20c0a2a381
commit
171de4d107
11 changed files with 36 additions and 86 deletions
|
@ -588,12 +588,7 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, gitR
|
|||
log.Error("CancelPreviousJobs: %v", err)
|
||||
}
|
||||
|
||||
if err := gitrepo.SetDefaultBranch(ctx, repo, newBranchName); err != nil {
|
||||
if !git.IsErrUnsupportedVersion(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return gitrepo.SetDefaultBranch(ctx, repo, newBranchName)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue