Browse Source

[git] cherry-move: use plumbing to list branches

Use git for-each-ref instead of git branch to check the existence of a
branch.
master
Matteo Cypriani 10 years ago
parent
commit
a5eca28a97
  1. 3
      git/git-cherry-move

3
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

Loading…
Cancel
Save