From: Nanako Shiraishi Date: Thu, 04 Sep 2008 10:20:08 GMT Subject: Re: Re*: Peculiar behavior of git 1.5.6 Message-ID: <20080904192008.6117@nanako3.lavabit.com> In-Reply-To: <7v3akg5jul.fsf_-_@gitster.siamese.dyndns.org> Quoting Junio C Hamano : > In any case, I think this should fix the unrelated issue. > > -- >8 -- > stash: refresh the index before deciding if the work tree is dirty > > Unlike the case where the user does have a real change in the work tree, > refusing to work because of unclean stat information is not very helpful. > > Signed-off-by: Junio C Hamano Acked-by: Nanako Shiraishi > --- > git-stash.sh | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git c/git-stash.sh w/git-stash.sh > index e15c12a..d799c76 100755 > --- c/git-stash.sh > +++ w/git-stash.sh > @@ -39,6 +39,7 @@ clear_stash () { > create_stash () { > stash_msg="$1" > > + git update-index -q --refresh > if no_changes > then > exit 0 > @@ -101,6 +102,7 @@ save_stash () { > > stash_msg="$*" > > + git update-index -q --refresh > if no_changes > then > echo 'No local changes to save' > @@ -150,6 +152,7 @@ show_stash () { > } > > apply_stash () { > + git update-index -q --refresh && > git diff-files --quiet --ignore-submodules || > die 'Cannot restore on top of a dirty state' > -- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/