aboutsummaryrefslogtreecommitdiff
path: root/git-codereview
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2015-08-25 06:44:07 +0000
committerAndrew Gerrand <adg@golang.org>2015-08-25 22:07:40 +0000
commitb28f13fb45d2f5f4897f8af2cb359876b46dfaf5 (patch)
tree8a1466d266a1e8584f7f44cc4c7eca06de24b73c /git-codereview
parent0d7922879a3c8f00706afeff7e19df53620dfc64 (diff)
downloadgo-x-review-b28f13fb45d2f5f4897f8af2cb359876b46dfaf5.tar.xz
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>
Diffstat (limited to 'git-codereview')
-rw-r--r--git-codereview/branch.go14
1 files changed, 1 insertions, 13 deletions
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 @@ import (
"fmt"
"os/exec"
"regexp"
- "runtime"
"strings"
)
@@ -52,16 +51,6 @@ func (b *Branch) DetachedHead() bool {
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 @@ func (b *Branch) OriginBranch() string {
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))