From: Ori Avtalion Date: Tue, 11 Aug 2009 11:12:13 GMT Subject: [PATCH] git stash: Give friendlier error when there is nothing to apply Message-ID: <4a81559c.05ae660a.591b.010b@mx.google.com> The old message was scary and included a 'fatal' error from rev-parse: fatal: Needed a single revision : no valid stashed state found The new message is identical to the one given by 'git stash branch', and given *before* the check for a dirty working tree. Previously, the command prompted the user to clean a dirty working tree when there is nothing to apply. Signed-off-by: Ori Avtalion --- git-stash.sh | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 03e589f..aa84144 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -162,6 +162,8 @@ show_stash () { } apply_stash () { + have_stash || die 'Nothing to apply' + git update-index -q --refresh && git diff-files --quiet --ignore-submodules || die 'Cannot apply to a dirty working tree, please stage your changes' -- 1.6.4.73.gc144.dirty