summaryrefslogtreecommitdiffstats
path: root/modules/repofiles/update.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-12-28 03:17:37 +0800
committerzeripath <art27@cantab.net>2019-12-27 19:17:37 +0000
commit0bcf644da4c3d21fad3ce8f33ccc26f8110568d6 (patch)
tree06f6f7c4d21efff1fa49439b671f492e8f01e409 /modules/repofiles/update.go
parente3a5b8321240e489bb9048ecf2caccf73c0abc36 (diff)
downloadgitea-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.go6
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)