diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/branches.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/branches.go b/models/branches.go index 045019314a..21b23c75d9 100644 --- a/models/branches.go +++ b/models/branches.go @@ -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 |