|
|
|
@ -1414,6 +1414,10 @@ func DeleteRepository(uid, repoID int64) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if err = sess.Commit(); err != nil { |
|
|
|
|
return fmt.Errorf("Commit: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Remove repository files.
|
|
|
|
|
repoPath := repo.repoPath(sess) |
|
|
|
|
RemoveAllWithNotice("Delete repository files", repoPath) |
|
|
|
@ -1425,10 +1429,6 @@ func DeleteRepository(uid, repoID int64) error {
|
|
|
|
|
RemoveAllWithNotice("Delete attachment", attachmentPaths[i]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if err = sess.Commit(); err != nil { |
|
|
|
|
return fmt.Errorf("Commit: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if repo.NumForks > 0 { |
|
|
|
|
if _, err = x.Exec("UPDATE `repository` SET fork_id=0,is_fork=? WHERE fork_id=?", false, repo.ID); err != nil { |
|
|
|
|
log.Error(4, "reset 'fork_id' and 'is_fork': %v", err) |
|
|
|
|