diff --git a/bin/git-squash b/bin/git-squash index 71fc7ed..98ab229 100755 --- a/bin/git-squash +++ b/bin/git-squash @@ -5,8 +5,8 @@ msg=$2 test -z $src && echo "source branch required." && exit 1 -git merge --squash $src && git branch -d $src +git merge --squash $src -if test -n $msg - git commit -a -m "$msg" -fi \ No newline at end of file +if test -n "$msg"; then + git commit -a -m "$msg" && git branch -D $src +fi