1
0
mirror of https://github.com/openshift/source-to-image.git synced 2026-02-05 12:44:54 +01:00

Merge pull request #774 from bparees/quiet

Merged by openshift-bot
This commit is contained in:
OpenShift Bot
2017-07-07 10:07:20 -04:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ func TestCloneWithContext(t *testing.T) {
if filepath.ToSlash(fs.RemoveDirName) != "upload/tmp" {
t.Errorf("Expected to remove the upload/tmp directory")
}
if !reflect.DeepEqual(cr.Args, []string{"checkout", "ref1"}) {
if !reflect.DeepEqual(cr.Args, []string{"checkout", "--quiet", "ref1"}) {
t.Errorf("Unexpected command arguments: %#v", cr.Args)
}
}

View File

@@ -13,6 +13,8 @@ import (
"strconv"
"strings"
log "github.com/golang/glog"
"github.com/openshift/source-to-image/pkg/api"
s2ierr "github.com/openshift/source-to-image/pkg/errors"
"github.com/openshift/source-to-image/pkg/util"
@@ -516,7 +518,10 @@ func (h *stiGit) Checkout(repo, ref string) error {
Stderr: os.Stderr,
Dir: repo,
}
return h.RunWithOptions(opts, "git", "checkout", ref)
if log.V(1) {
return h.RunWithOptions(opts, "git", "checkout", ref)
}
return h.RunWithOptions(opts, "git", "checkout", "--quiet", ref)
}
// SubmoduleInit initializes/clones submodules

View File

@@ -195,7 +195,7 @@ func TestGitCheckout(t *testing.T) {
if ch.Name != "git" {
t.Errorf("Unexpected command name: %q", ch.Name)
}
if !reflect.DeepEqual(ch.Args, []string{"checkout", "ref1"}) {
if !reflect.DeepEqual(ch.Args, []string{"checkout", "--quiet", "ref1"}) {
t.Errorf("Unexpected command arguments: %#v", ch.Args)
}
if ch.Opts.Dir != "repo1" {