parse-remote: replace unnecessary sed invocation
[gitweb.git] / git-parse-remote.sh
index 1cc2ba6e09614fa55ad205145a3bdacfb78bf283..d3782d9559af8a0b99262d37f99b6035bd69e320 100644 (file)
@@ -55,7 +55,8 @@ get_remote_url () {
 }
 
 get_default_remote () {
-       curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
+       curr_branch=$(git symbolic-ref -q HEAD)
+       curr_branch="${cur_branch#refs/heads/}"
        origin=$(git config --get "branch.$curr_branch.remote")
        echo ${origin:-origin}
 }