git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git stash: Give friendlier error when there is nothing to apply
@ 2009-08-11 11:12 Ori Avtalion
  2009-08-11 12:09 ` Thomas Rast
  0 siblings, 1 reply; 7+ messages in thread
From: Ori Avtalion @ 2009-08-11 11:12 UTC (permalink / raw)
  To: git

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 <ori@avtalion.name>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-15  1:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 11:12 [PATCH] git stash: Give friendlier error when there is nothing to apply Ori Avtalion
2009-08-11 12:09 ` Thomas Rast
2009-08-11 11:12   ` [PATCH] git stash: Give friendlier errors " Ori Avtalion
2009-08-13  7:35     ` Thomas Rast
2009-08-14 19:52     ` Junio C Hamano
2009-08-14 21:39       ` Nanako Shiraishi
2009-08-15  1:50         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).