summaryrefslogtreecommitdiff
path: root/git-parse-remote.sh
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2011-03-30 08:48:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-30 18:42:08 (GMT)
commit9ecd3ada6dd7fe80109c48c48f30164c066d37ad (patch)
treedda822f1b29dc6f1fd45bfcf18acdd0a8e4c409d /git-parse-remote.sh
parent90cff968b3757061914f83b85a8d58cb9f29e72a (diff)
downloadgit-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.zip
git-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.tar.gz
git-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.tar.bz2
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 1cc2ba6..d3782d9 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}
}