From: Stephen Boyd Date: Wed, 30 Mar 2011 08:48:40 +0000 (-0700) Subject: parse-remote: replace unnecessary sed invocation X-Git-Tag: v1.7.5-rc0~2^2~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9ecd3ada6dd7fe80109c48c48f30164c066d37ad;p=git.git parse-remote: replace unnecessary sed invocation Just use parameter expansion instead. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 1cc2ba6e0..d3782d955 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} }