git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pull: replace unnecessary sed invocation
@ 2010-03-18  5:10 Stephen Boyd
  2010-03-18 13:30 ` Gabriel Filion
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2010-03-18  5:10 UTC (permalink / raw)
  To: git, git; +Cc: Junio C Hamano

Getting the shortened branch name is as easy as using the shell's
parameter expansion.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---

Saw this while reading the code.

 git-pull.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index 38331a8..246a3a4 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -41,7 +41,7 @@ strategy_args= diffstat= no_commit= squash= no_ff= ff_only=
 log_arg= verbosity=
 merge_args=
 curr_branch=$(git symbolic-ref -q HEAD)
-curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
+curr_branch_short="${curr_branch#refs/heads/}"
 rebase=$(git config --bool branch.$curr_branch_short.rebase)
 while :
 do
-- 
1.7.0.2.276.g60daf


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-18 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18  5:10 [PATCH] pull: replace unnecessary sed invocation Stephen Boyd
2010-03-18 13:30 ` Gabriel Filion
2010-03-18 14:46   ` Brandon Casey
2010-03-18 14:48   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).