update-bash: avoid shellout for stripping prefix
This commit is contained in:
parent
83e1373376
commit
9cd2658073
@ -54,8 +54,8 @@ repo_var() {
|
|||||||
|
|
||||||
upstream_branch() {
|
upstream_branch() {
|
||||||
local upstream_branch
|
local upstream_branch
|
||||||
upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null |
|
upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null)"
|
||||||
sed -e 's|refs/remotes/origin/||' )"
|
upstream_branch="${upstream_branch#refs/remotes/origin/}"
|
||||||
[[ -z "$upstream_branch" ]] && upstream_branch="master"
|
[[ -z "$upstream_branch" ]] && upstream_branch="master"
|
||||||
echo "$upstream_branch"
|
echo "$upstream_branch"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user