Merge pull request #654 from spacewander/replace-xargs-r

git-delete-merged-branches: replace xargs -r option
This commit is contained in:
hemanth.hm 2017-05-09 14:49:55 +05:30 committed by GitHub
commit 9334c9db31

View file

@ -1,3 +1,7 @@
#!/usr/bin/env bash
git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn | xargs -r -n 1 git branch -d
branches=$(git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn)
if [ -n "$branches" ]
then
echo "$branches" | xargs -n 1 git branch -d
fi