From a5eca28a9701a27bd508ac859e083461076a3f16 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 1 Jul 2011 15:52:05 +0200 Subject: [PATCH] [git] cherry-move: use plumbing to list branches Use git for-each-ref instead of git branch to check the existence of a branch. --- git/git-cherry-move | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git/git-cherry-move b/git/git-cherry-move index fa854c8..11dc3fd 100755 --- a/git/git-cherry-move +++ b/git/git-cherry-move @@ -16,8 +16,7 @@ set -e assert_branch_exists() { - RET=$(git branch | sed --quiet "s/^\*\? \+${1}$/${1}/p") - if [ "$RET" != $1 ] ; then + if ! git for-each-ref refs/heads | grep "/${1}$" >/dev/null ; then echo "The branch $1 does not exist!" exit 2 fi