mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-12 13:28:30 +00:00
Return 409 when gc conflict (#731)
* Return 409 when gc conflict * Go return 409 when gc conflict * Return gc conflict when sync repo --------- Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
@@ -1077,8 +1077,12 @@ func putUpdateBranchCB(rsp http.ResponseWriter, r *http.Request) *appError {
|
||||
token = utils.GetAuthorizationToken(r.Header)
|
||||
}
|
||||
if err := fastForwardOrMerge(user, token, repo, base, newCommit); err != nil {
|
||||
err := fmt.Errorf("Fast forward merge for repo %s is failed: %v", repoID, err)
|
||||
return &appError{err, "", http.StatusInternalServerError}
|
||||
if errors.Is(err, ErrGCConflict) {
|
||||
return &appError{nil, "GC Conflict.\n", http.StatusConflict}
|
||||
} else {
|
||||
err := fmt.Errorf("Fast forward merge for repo %s is failed: %v", repoID, err)
|
||||
return &appError{err, "", http.StatusInternalServerError}
|
||||
}
|
||||
}
|
||||
|
||||
go mergeVirtualRepoPool.AddTask(repoID, "")
|
||||
|
Reference in New Issue
Block a user