]> source.dussan.org Git - gitea.git/commitdiff
more clear error
authorUnknwon <u@gogs.io>
Fri, 28 Aug 2015 11:28:26 +0000 (19:28 +0800)
committerUnknwon <u@gogs.io>
Fri, 28 Aug 2015 11:28:26 +0000 (19:28 +0800)
modules/git/repo_branch.go

index 726019c1b1e15326df1b31c9ab332f6eb88de6da..a4e060533c80a2801c9150b5e34d2223462fbf40 100644 (file)
@@ -5,7 +5,6 @@
 package git
 
 import (
-       "errors"
        "strings"
 
        "github.com/Unknwon/com"
@@ -23,7 +22,7 @@ func (repo *Repository) IsBranchExist(branchName string) bool {
 func (repo *Repository) GetBranches() ([]string, error) {
        stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "show-ref", "--heads")
        if err != nil {
-               return nil, errors.New(stderr)
+               return nil, concatenateError(err, stderr)
        }
        infos := strings.Split(stdout, "\n")
        branches := make([]string, len(infos)-1)