parse-remote: replace unnecessary sed invocation
Just use parameter expansion instead. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stephen Boyd committed
Mar 30, 2011 at 01:48 UTC
9ecd3ada6dd7fe80109c48c48f30164c066d37ad
1 file changed
+2
-1
git-parse-remote.sh
+2
-1
@@ -55,7 +55,8 @@ get_remote_url () {
55
}
56
57
get_default_remote () {
58
- curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
58
+ curr_branch=$(git symbolic-ref -q HEAD)
59
+ curr_branch="${cur_branch#refs/heads/}"
60
origin=$(git config --get "branch.$curr_branch.remote")
61
echo ${origin:-origin}
62
}