Skip to content

Commit

Permalink
git-delete-merged-branches: use "xargs -r" to prevent error when ther…
Browse files Browse the repository at this point in the history
…e are no branches to delete

Prevents this error:

    $ git delete-merged-branches
    fatal: branch name required
  • Loading branch information
richardfearn committed Nov 19, 2016
1 parent fd2de52 commit 8cbbf90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/git-delete-merged-branches
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn | xargs -n 1 git branch -d
git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn | xargs -r -n 1 git branch -d

0 comments on commit 8cbbf90

Please sign in to comment.