diff --git a/git-stree b/git-stree index 317f5e0..4fdb099 100755 --- a/git-stree +++ b/git-stree @@ -143,18 +143,17 @@ function error # Command: `git stree forget` function forget_subtrees { - if [ -z "${args[1]}" ]; then - for name in $(get_subtree_list simple); do - rm_subtree "$name" && discreet "• Removed subtree '$name'" - done - yay 'Successfully removed all subtree definitions.' - else - error false "This is not the command you're looking for. -git stree forget removes all subtrees defined for this repository. -You specified a specific subtree ($1) on the command line, -so you probably want: git stree rm $1 -" + if [ -n "${args[1]}" ]; then + error false "This is not the command you're looking for. + git stree forget removes all subtrees defined for this repository. + You specified a specific subtree ($1) on the command line, + so you probably want: git stree rm $1 + " fi + for name in $(get_subtree_list simple); do + rm_subtree "$name" && discreet "• Removed subtree '$name'" + done + yay 'Successfully removed all subtree definitions.' } # Helper: computes a backport branch name based on the passed CLI name.