mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	* Remove DeletedBranch and LFSLocks. * Sort beans. Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -1454,24 +1454,26 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
 | 
			
		||||
	if err := deleteBeans(sess,
 | 
			
		||||
		&Access{RepoID: repo.ID},
 | 
			
		||||
		&Action{RepoID: repo.ID},
 | 
			
		||||
		&Watch{RepoID: repoID},
 | 
			
		||||
		&Star{RepoID: repoID},
 | 
			
		||||
		&Mirror{RepoID: repoID},
 | 
			
		||||
		&Milestone{RepoID: repoID},
 | 
			
		||||
		&Release{RepoID: repoID},
 | 
			
		||||
		&Collaboration{RepoID: repoID},
 | 
			
		||||
		&PullRequest{BaseRepoID: repoID},
 | 
			
		||||
		&RepoUnit{RepoID: repoID},
 | 
			
		||||
		&RepoRedirect{RedirectRepoID: repoID},
 | 
			
		||||
		&Webhook{RepoID: repoID},
 | 
			
		||||
		&HookTask{RepoID: repoID},
 | 
			
		||||
		&Notification{RepoID: repoID},
 | 
			
		||||
		&CommitStatus{RepoID: repoID},
 | 
			
		||||
		&RepoIndexerStatus{RepoID: repoID},
 | 
			
		||||
		&LanguageStat{RepoID: repoID},
 | 
			
		||||
		&Comment{RefRepoID: repoID},
 | 
			
		||||
		&Task{RepoID: repoID},
 | 
			
		||||
		&CommitStatus{RepoID: repoID},
 | 
			
		||||
		&DeletedBranch{RepoID: repoID},
 | 
			
		||||
		&HookTask{RepoID: repoID},
 | 
			
		||||
		&LFSLock{RepoID: repoID},
 | 
			
		||||
		&LanguageStat{RepoID: repoID},
 | 
			
		||||
		&Milestone{RepoID: repoID},
 | 
			
		||||
		&Mirror{RepoID: repoID},
 | 
			
		||||
		&Notification{RepoID: repoID},
 | 
			
		||||
		&ProtectedBranch{RepoID: repoID},
 | 
			
		||||
		&PullRequest{BaseRepoID: repoID},
 | 
			
		||||
		&Release{RepoID: repoID},
 | 
			
		||||
		&RepoIndexerStatus{RepoID: repoID},
 | 
			
		||||
		&RepoRedirect{RedirectRepoID: repoID},
 | 
			
		||||
		&RepoUnit{RepoID: repoID},
 | 
			
		||||
		&Star{RepoID: repoID},
 | 
			
		||||
		&Task{RepoID: repoID},
 | 
			
		||||
		&Watch{RepoID: repoID},
 | 
			
		||||
		&Webhook{RepoID: repoID},
 | 
			
		||||
	); err != nil {
 | 
			
		||||
		return fmt.Errorf("deleteBeans: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
@@ -1487,10 +1489,6 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if _, err := sess.Where("repo_id = ?", repoID).Delete(new(RepoUnit)); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if repo.IsFork {
 | 
			
		||||
		if _, err := sess.Exec("UPDATE `repository` SET num_forks=num_forks-1 WHERE id=?", repo.ForkID); err != nil {
 | 
			
		||||
			return fmt.Errorf("decrease fork count: %v", err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user