Skip to content

Commit 9ecd3ad

Browse files
bebarinogitster
authored andcommitted
parse-remote: replace unnecessary sed invocation
Just use parameter expansion instead. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 90cff96 commit 9ecd3ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-parse-remote.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ get_remote_url () {
5555
}
5656

5757
get_default_remote () {
58-
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
58+
curr_branch=$(git symbolic-ref -q HEAD)
59+
curr_branch="${cur_branch#refs/heads/}"
5960
origin=$(git config --get "branch.$curr_branch.remote")
6061
echo ${origin:-origin}
6162
}

0 commit comments

Comments
 (0)