From 417b4338f442dd1dd999d9df67a2c4bd81a24c44 Mon Sep 17 00:00:00 2001 From: creste Date: Fri, 6 Jan 2017 07:35:01 -0600 Subject: [PATCH] Addressed review comments made by @ttaylorr --- git/git.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/git/git.go b/git/git.go index 158de8b1..ed7795be 100644 --- a/git/git.go +++ b/git/git.go @@ -576,12 +576,10 @@ func GetCommitSummary(commit string) (*CommitSummary, error) { func isCygwin() bool { cmd := subprocess.ExecCommand("uname") out, err := cmd.Output() - output := string(out) - if (err == nil) && (strings.Contains(output, "CYGWIN")) { - return true - } else { + if err != nil { return false } + return bytes.Contains(out, []byte("CYGWIN")) } func translateCygwinPath(path string) (string, error) { @@ -589,8 +587,7 @@ func translateCygwinPath(path string) (string, error) { buf := &bytes.Buffer{} cmd.Stderr = buf out, err := cmd.Output() - output := string(out) - output = strings.TrimSpace(output) + output := strings.TrimSpace(string(out)) if err != nil { return path, fmt.Errorf("Failed to translate path from cygwin to windows: %s", buf.String()) }