1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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

This commit is contained in:
Lunny Xiao
2019-12-28 12:41:41 +08:00
committed by GitHub
parent a3928fd820
commit 9409ac9030
2 changed files with 12 additions and 1 deletions

View File

@@ -480,6 +480,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() {
log.Trace("Doing: DeletedBranchesCleanup")