summaryrefslogtreecommitdiff
path: root/git-parse-remote.sh
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2011-03-30 01:48:40 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-30 11:42:08 -0700
commit9ecd3ada6dd7fe80109c48c48f30164c066d37ad (patch)
treedda822f1b29dc6f1fd45bfcf18acdd0a8e4c409d /git-parse-remote.sh
parent90cff968b3757061914f83b85a8d58cb9f29e72a (diff)
downloadgit-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.tar.gz
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>
Diffstat (limited to 'git-parse-remote.sh')
-rw-r--r--git-parse-remote.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 1cc2ba6e09..d3782d9559 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -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}
}