diff options
author | Stephen Boyd <bebarino@gmail.com> | 2011-03-30 10:48:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-30 20:42:08 +0200 |
commit | 9ecd3ada6dd7fe80109c48c48f30164c066d37ad (patch) | |
tree | dda822f1b29dc6f1fd45bfcf18acdd0a8e4c409d /git-parse-remote.sh | |
parent | HOME must be set before calling git-init when creating test repositories (diff) | |
download | git-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.tar.xz git-9ecd3ada6dd7fe80109c48c48f30164c066d37ad.zip |
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.sh | 3 |
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} } |