Skip to content

Commit

Permalink
parse-remote: replace unnecessary sed invocation
Browse files Browse the repository at this point in the history
Just use parameter expansion instead.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stephen Boyd authored and Junio C Hamano committed Mar 30, 2011
1 parent 90cff96 commit 9ecd3ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-parse-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down

0 comments on commit 9ecd3ad

Please sign in to comment.