diff --git a/git/bin/git-purge b/git/bin/git-purge index aad3a94..6ebacbe 100755 --- a/git/bin/git-purge +++ b/git/bin/git-purge @@ -1,3 +1,9 @@ #!/usr/bin/env sh -git branch --merged|egrep -v "(^*|master|dev)" | xargs git branch -d +BRANCHES=$(git branch --merged|egrep -v "(^\*|master|dev)") + +if [ -z "${BRANCHES}" ] ; then + echo "Nothing to delete" +else + git branch -d ${BRANCHES} +fi