Skip to content
Snippets Groups Projects
Commit 9cd26580 authored by Xu Cheng's avatar Xu Cheng
Browse files

update-bash: avoid shellout for stripping prefix

parent 83e13733
No related branches found
No related tags found
No related merge requests found
......@@ -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"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment