diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-28 03:17:37 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-12-27 19:17:37 +0000 |
commit | 0bcf644da4c3d21fad3ce8f33ccc26f8110568d6 (patch) | |
tree | 06f6f7c4d21efff1fa49439b671f492e8f01e409 /modules/repofiles/update.go | |
parent | e3a5b8321240e489bb9048ecf2caccf73c0abc36 (diff) | |
download | gitea-0bcf644da4c3d21fad3ce8f33ccc26f8110568d6.tar.gz gitea-0bcf644da4c3d21fad3ce8f33ccc26f8110568d6.zip |
Fix deleted branch isn't removed when push the branch again (#9516)
Diffstat (limited to 'modules/repofiles/update.go')
-rw-r--r-- | modules/repofiles/update.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go index c97d3d46e4..19c3d5b51c 100644 --- a/modules/repofiles/update.go +++ b/modules/repofiles/update.go @@ -520,6 +520,12 @@ func PushUpdates(repo *models.Repository, optsList []*PushUpdateOptions) error { } } + if opts.NewCommitID != git.EmptySHA { + if err = models.RemoveDeletedBranch(repo.ID, opts.Branch); err != nil { + log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, opts.Branch, err) + } + } + log.Trace("TriggerTask '%s/%s' by %s", repo.Name, opts.Branch, pusher.Name) go pull_service.AddTestPullRequestTask(pusher, repo.ID, opts.Branch, true) |