aboutsummaryrefslogtreecommitdiff
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go
index ec6dfbfc..c640db5d 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -469,20 +469,20 @@ func initRepoCommit(tmpPath string, sig *git.Signature) (err error) {
if _, stderr, err = process.ExecDir(-1,
tmpPath, fmt.Sprintf("initRepoCommit(git add): %s", tmpPath),
"git", "add", "--all"); err != nil {
- return errors.New("git add: " + stderr)
+ return fmt.Errorf("git add: %s", stderr)
}
if _, stderr, err = process.ExecDir(-1,
tmpPath, fmt.Sprintf("initRepoCommit(git commit): %s", tmpPath),
"git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email),
"-m", "initial commit"); err != nil {
- return errors.New("git commit: " + stderr)
+ return fmt.Errorf("git commit: %s", stderr)
}
if _, stderr, err = process.ExecDir(-1,
tmpPath, fmt.Sprintf("initRepoCommit(git push): %s", tmpPath),
"git", "push", "origin", "master"); err != nil {
- return errors.New("git push: " + stderr)
+ return fmt.Errorf("git push: %s", stderr)
}
return nil
}
@@ -1004,6 +1004,8 @@ func DeleteRepository(uid, repoID int64) error {
return err
} else if _, err = sess.Delete(&Collaboration{RepoID: repoID}); err != nil {
return err
+ } else if _, err = sess.Delete(&PullRequest{BaseRepoID: repoID}); err != nil {
+ return err
}
// Delete comments and attachments.