Skip to content

Commit

Permalink
Show an error if a user tries to do git stree forget with a stree name
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Garrett committed Apr 25, 2015
1 parent aba5fbf commit 860c1a0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions git-stree
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ function error
# Command: `git stree forget`
function forget_subtrees
{
for name in $(get_subtree_list simple); do
rm_subtree "$name" && discreet "• Removed subtree '$name'"
done
yay 'Successfully removed all subtree definitions.'
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
"
fi
}

# Helper: computes a backport branch name based on the passed CLI name.
Expand Down

0 comments on commit 860c1a0

Please sign in to comment.