fix: re-add log outputs

This commit is contained in:
Pieter Vincken
2020-06-09 16:56:20 +02:00
parent b97df057c1
commit e630334837

View File

@@ -4,6 +4,7 @@
package git
import (
"log"
"os/exec"
"github.com/pkg/errors"
@@ -35,8 +36,9 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
"--depth=1",
repoSpec.CloneSpec(),
repoSpec.Dir.String())
_, err = cmd.CombinedOutput()
out, err = cmd.CombinedOutput()
if err != nil {
log.Printf("Error cloning git repo: %s", out)
return errors.Wrapf(
err,
"trouble cloning git repo %v in %s",
@@ -50,8 +52,9 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
"origin",
repoSpec.Ref)
cmd.Dir = repoSpec.Dir.String()
_, err = cmd.CombinedOutput()
out, err = cmd.CombinedOutput()
if err != nil {
log.Printf("Error fetching ref: %s", out)
return errors.Wrapf(err, "trouble fetching %s", repoSpec.Ref)
}
@@ -60,8 +63,9 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
"checkout",
repoSpec.Ref)
cmd.Dir = repoSpec.Dir.String()
_, err = cmd.CombinedOutput()
out, err = cmd.CombinedOutput()
if err != nil {
log.Printf("Error checking out ref: %s", out)
return errors.Wrapf(err, "trouble checking out %s", repoSpec.Ref)
}
@@ -72,8 +76,9 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
"--init",
"--recursive")
cmd.Dir = repoSpec.Dir.String()
_, err = cmd.CombinedOutput()
out, err = cmd.CombinedOutput()
if err != nil {
log.Printf("Error fetching submodules: %s", out)
return errors.Wrapf(err, "trouble fetching submodules for %s", repoSpec.CloneSpec())
}