Browse code

made commitchecker error statements more verbose

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Steve Kuznetsov authored on 2016/04/22 23:37:23
Showing 1 changed files
... ...
@@ -141,9 +141,9 @@ func (f File) GodepsRepoChanged() (string, error) {
141 141
 
142 142
 func CommitsBetween(a, b string) ([]Commit, error) {
143 143
 	commits := []Commit{}
144
-	stdout, _, err := run("git", "log", "--oneline", fmt.Sprintf("%s..%s", a, b))
144
+	stdout, stderr, err := run("git", "log", "--oneline", fmt.Sprintf("%s..%s", a, b))
145 145
 	if err != nil {
146
-		return nil, fmt.Errorf("error executing git log: %s", err)
146
+		return nil, fmt.Errorf("error executing git log: %s: %s", stderr, err)
147 147
 	}
148 148
 	for _, log := range strings.Split(stdout, "\n") {
149 149
 		if len(log) == 0 {
... ...
@@ -255,9 +255,9 @@ func CurrentRev(repoDir string) (string, error) {
255 255
 
256 256
 func filesInCommit(sha string) ([]File, error) {
257 257
 	files := []File{}
258
-	stdout, _, err := run("git", "diff-tree", "--no-commit-id", "--name-only", "-r", sha)
258
+	stdout, stderr, err := run("git", "diff-tree", "--no-commit-id", "--name-only", "-r", sha)
259 259
 	if err != nil {
260
-		return nil, err
260
+		return nil, fmt.Errorf("%s: %s", stderr, err)
261 261
 	}
262 262
 	for _, filename := range strings.Split(stdout, "\n") {
263 263
 		if len(filename) == 0 {