From 4f8e411f71a57408c0bdee53836c483c26c8e36e Mon Sep 17 00:00:00 2001 From: Richard Fearn Date: Sat, 19 Nov 2016 16:51:36 +0000 Subject: [PATCH] git-fresh-branch: fix handling of 'yes' response when there are changes 'break' isn't valid in its current location in the script, resulting in an error like: /usr/bin/git-fresh-branch: line 42: break: only meaningful in a `for', `while', or `until' loop Since there's a call to 'clean' right at the end of the script, do nothing if anything beginning 'Y' or 'y' is entered; execution will continue to the end of the script, and 'clean' will be called. --- bin/git-fresh-branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-fresh-branch b/bin/git-fresh-branch index 42b567a..461bd6c 100755 --- a/bin/git-fresh-branch +++ b/bin/git-fresh-branch @@ -16,7 +16,7 @@ clean() if [ ! -z "$changes" ]; then read -p "All untracked changes will be lost. Continue [y/N]? " res case $res in - [Yy]* ) clean; break;; + [Yy]* ) ;; * ) exit 0;; esac fi