diff --git a/bin/git-ps b/bin/git-ps index 96371ec..54c866d 100755 --- a/bin/git-ps +++ b/bin/git-ps @@ -25,4 +25,6 @@ for branch in $(git branch --merged | grep -v '^*'); do done step "Removing local branches where remote branch is gone..." -git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D +if ( git branch -vv | grep -q ': gone ]' ); then + git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D +fi