aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2016-01-20 20:29:47 +0800
committerXu Cheng2016-01-21 21:14:55 +0800
commit9cd2658073f642af615f24133db9f02c0df2bb9a (patch)
treead78d8d58488a50f3fb139460a1ece50004d9652 /Library/Homebrew/cmd
parent83e13733762fdc728980e57a82cd19979d30141d (diff)
downloadbrew-9cd2658073f642af615f24133db9f02c0df2bb9a.tar.bz2
update-bash: avoid shellout for stripping prefix
Diffstat (limited to 'Library/Homebrew/cmd')
-rwxr-xr-xLibrary/Homebrew/cmd/update-bash.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update-bash.sh b/Library/Homebrew/cmd/update-bash.sh
index 3b3eac482..27cbd32ed 100755
--- a/Library/Homebrew/cmd/update-bash.sh
+++ b/Library/Homebrew/cmd/update-bash.sh
@@ -54,8 +54,8 @@ repo_var() {
upstream_branch() {
local upstream_branch
- upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null |
- sed -e 's|refs/remotes/origin/||' )"
+ upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null)"
+ upstream_branch="${upstream_branch#refs/remotes/origin/}"
[[ -z "$upstream_branch" ]] && upstream_branch="master"
echo "$upstream_branch"
}