diff options
author | Unknwon <u@gogs.io> | 2015-09-02 09:26:56 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-02 09:26:56 -0400 |
commit | 953bb06857f59f5c6987f68a08a94cf5a885b456 (patch) | |
tree | 196a45fa4e7f8808b35790981eb0e417bbfa1a61 /models/repo.go | |
parent | 6ea28f2a4759c5192811b12de054e7ad62f080f6 (diff) | |
download | gitea-953bb06857f59f5c6987f68a08a94cf5a885b456.tar.gz gitea-953bb06857f59f5c6987f68a08a94cf5a885b456.zip |
basic PR feature
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/models/repo.go b/models/repo.go index ec6dfbfcbf..c640db5d49 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. |