diff options
| author | Xu Cheng | 2016-01-20 20:29:47 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-01-21 21:14:55 +0800 |
| commit | 9cd2658073f642af615f24133db9f02c0df2bb9a (patch) | |
| tree | ad78d8d58488a50f3fb139460a1ece50004d9652 /Library/Homebrew/cmd | |
| parent | 83e13733762fdc728980e57a82cd19979d30141d (diff) | |
| download | brew-9cd2658073f642af615f24133db9f02c0df2bb9a.tar.bz2 | |
update-bash: avoid shellout for stripping prefix
Diffstat (limited to 'Library/Homebrew/cmd')
| -rwxr-xr-x | Library/Homebrew/cmd/update-bash.sh | 4 |
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" } |
