Revert "review: git change doesn't pass @{u} correctly on windows."
This reverts commit 0d7922879a3c8f00706afeff7e19df53620dfc64.
This change fixed the behavior for older versions of Git, but newer versions were unaffected. Let's prioritize newer versions.
Change-Id: I7bf3a3653835a800ad5085522660d39ae3770d25
Reviewed-on: https://go-review.googlesource.com/13859
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/git-codereview/branch.go b/git-codereview/branch.go
index 01af0c9..5eacb10 100644
--- a/git-codereview/branch.go
+++ b/git-codereview/branch.go
@@ -9,7 +9,6 @@
"fmt"
"os/exec"
"regexp"
- "runtime"
"strings"
)
@@ -52,16 +51,6 @@
return b.Name == "HEAD"
}
-// Workaround on windows. git for windows can't handle @{u} as same as given.
-// It removes parens. And option '--' to skip parsing arguments doesn't work
-// correctly on git 2.5.0.
-func quoteOnWindows(branch string) string {
- if runtime.GOOS != "windows" {
- return branch
- }
- return "'" + branch + "'"
-}
-
// OriginBranch returns the name of the origin branch that branch b tracks.
// The returned name is like "origin/master" or "origin/dev.garbage" or
// "origin/release-branch.go1.4".
@@ -77,8 +66,7 @@
if b.originBranch != "" {
return b.originBranch
}
- argv := []string{"git", "rev-parse", "--abbrev-ref", quoteOnWindows(b.Name + "@{u}")}
-
+ argv := []string{"git", "rev-parse", "--abbrev-ref", b.Name + "@{u}"}
out, err := exec.Command(argv[0], argv[1:]...).CombinedOutput()
if err == nil && len(out) > 0 {
b.originBranch = string(bytes.TrimSpace(out))