diff options
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -11,6 +11,7 @@ import ( "io/ioutil" "go.wit.com/log" + "go.wit.com/lib/gui/shell" ) func (rs *RepoStatus) GetCurrentBranchName() string { @@ -95,7 +96,7 @@ func (rs *RepoStatus) gitDescribeByHash(hash string) (string, error) { if hash == "" { return "", errors.New("hash was blank") } - r := rs.Run([]string{"git", "describe", "--tags", "--always", hash}) + r := shell.PathRunLog(rs.Path(), []string{"git", "describe", "--tags", "--always", hash}, INFO) out := strings.Join(r.Stdout, "\n") if r.Error != nil { log.Warn("not in a git repo or bad hash?", r.Error, rs.Path()) @@ -109,7 +110,7 @@ func (rs *RepoStatus) gitDescribeByName(name string) (string, error) { if name == "" { // git will return the current tag - r := rs.Run([]string{"git", "describe", "--tags", "--always"}) + r := shell.PathRunLog(rs.Path(), []string{"git", "describe", "--tags", "--always"}, INFO) output := strings.Join(r.Stdout, "\n") if r.Error != nil { log.Warn("gitDescribeByName() not in a git repo?", r.Error, rs.Path()) @@ -121,7 +122,7 @@ func (rs *RepoStatus) gitDescribeByName(name string) (string, error) { return "", errors.New("gitDescribeByName() git fatal: Not a valid object name") } cmd := []string{"git", "describe", "--tags", "--always", name} - r := rs.Run(cmd) + r := shell.PathRunLog(rs.Path(), cmd, INFO) output := strings.Join(r.Stdout, "\n") if r.Error != nil { log.Warn("cmd =", cmd) @@ -211,7 +212,7 @@ func (rs *RepoStatus) DirtyList() []string { func (rs *RepoStatus) CheckDirty() bool { var start string = rs.dirtyLabel.String() cmd := []string{"git", "status", "--porcelain"} - r := rs.Run(cmd) + r := shell.PathRunLog(rs.Path(), cmd, INFO) out := strings.Join(r.Stdout, "\n") if r.Error != nil { log.Warn("CheckDirty() status cmd =", cmd) @@ -571,7 +572,7 @@ func (rs *RepoStatus) CheckBranches() bool { } var cmd []string cmd = append(cmd, "git", "show", "-s", "--format=%ci", hash) - r := rs.Run(cmd) + r := shell.PathRunLog(rs.Path(), cmd, INFO) if r.Error != nil { log.Log(WARN, "CheckBranches() git show error:", r.Error) } |
