Skip to content

Commit

Permalink
Remove use of '-C' flag in Git commands (#53)
Browse files Browse the repository at this point in the history
Set working directory directly on the Go command executor instead.

Fixes #50
  • Loading branch information
nmiyake authored Feb 5, 2017
1 parent adfe8e2 commit cbc0932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/distgo/pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func branch(gitDir string) (string, error) {
}

func trimmedCombinedGitCmdOutput(gitDir string, args ...string) (string, error) {
gitArgs := []string{"-C", gitDir}
cmd := exec.Command("git", append(gitArgs, args...)...)
cmd := exec.Command("git", args...)
cmd.Dir = gitDir
out, err := cmd.CombinedOutput()
if err != nil {
return "", errors.Wrapf(err, "Command %v failed. Output: %v", cmd.Args, string(out))
Expand Down

0 comments on commit cbc0932

Please sign in to comment.