aboutsummaryrefslogtreecommitdiff
path: root/modules/git
diff options
context:
space:
mode:
authorDon Bowman <don.waterloo@gmail.com>2015-08-12 21:10:00 +0000
committerDon Bowman <don.waterloo@gmail.com>2015-08-12 21:10:00 +0000
commit1cb46ede1acf4f8527e64fcae7e92672cad764b2 (patch)
treefabb54ee5f040be2a4ee5c95f87cb3e9fbf7bdea /modules/git
parent9e6bd31d76aa6d6495a2144466af78773f34d07c (diff)
parentaede5cdb04fdbf74d9c602062fdece9f408e90f4 (diff)
Merge branch 'master' of https://github.com/gogits/gogs
Conflicts: routers/repo/download.go
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo_tag.go2
-rw-r--r--modules/git/utils.go8
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/git/repo_tag.go b/modules/git/repo_tag.go
index ed994d48..45a1df70 100644
--- a/modules/git/repo_tag.go
+++ b/modules/git/repo_tag.go
@@ -27,7 +27,7 @@ func (repo *Repository) GetTags() ([]string, error) {
}
stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l")
if err != nil {
- return nil, errors.New(stderr)
+ return nil, concatenateError(err, stderr)
}
tags := strings.Split(stdout, "\n")
return tags[:len(tags)-1], nil
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 6abbca55..78792aaf 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -7,6 +7,7 @@ package git
import (
"bytes"
"container/list"
+ "fmt"
"os"
"path/filepath"
"strings"
@@ -67,3 +68,10 @@ func isFile(filePath string) bool {
}
return !f.IsDir()
}
+
+func concatenateError(err error, stderr string) error {
+ if len(stderr) == 0 {
+ return err
+ }
+ return fmt.Errorf("%v: %s", err, stderr)
+}