Run command only if there is any input

It doesn't make sense to run `git branch -d $BRANCH` if the `$BRANCH` is empty.
This commit is contained in:
Jakub Chábek 2017-05-11 13:23:39 +02:00 committed by GitHub
parent 291e96dcd0
commit f5b220ff0e

View File

@ -48,7 +48,7 @@ alias gau='git add --update'
alias gb='git branch' alias gb='git branch'
alias gba='git branch -a' alias gba='git branch -a'
alias gbd='git branch -d' alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -r -n 1 git branch -d'
alias gbl='git blame -b -w' alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged' alias gbnm='git branch --no-merged'
alias gbr='git branch --remote' alias gbr='git branch --remote'