Fix deleted branch isn't removed when push the branch again (#9516)

This commit is contained in:
Lunny Xiao authored and zeripath committed 2019-12-27 19:17:37 +00:00
1 parent e3a5b83212
commit 0bcf644da4
2 files changed
+12

No files matched your search

+6
View File
@@ -525,6 +525,12 @@ func (deletedBranch *DeletedBranch) LoadUser() {
deletedBranch.DeletedBy = user
}
// RemoveDeletedBranch removes all deleted branches
func RemoveDeletedBranch(repoID int64, branch string) error {
_, err := x.Where("repo_id=? AND name=?", repoID, branch).Delete(new(DeletedBranch))
return err
}
// RemoveOldDeletedBranches removes old deleted branches
func RemoveOldDeletedBranches(ctx context.Context) {
// Nothing to do for shutdown or terminate