[PATCH] parse-remote: replace unnecessary sed invocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just use parameter expansion instead.

Signed-off-by: Stephen Boyd <bebarino@xxxxxxxxx>
---

Cleaning out the attic.

 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 e7013f7..9168879 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -5,7 +5,8 @@
 GIT_DIR=$(git rev-parse -q --git-dir) || :;
 
 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}
 }
-- 
1.7.4.2.422.g537d99

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]