Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
stash: refresh the index before deciding if the work tree is dirty
author
Junio C Hamano
<gitster@pobox.com>
Thu, 4 Sep 2008 09:41:22 +0000
(
02:41
-0700)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 6 Sep 2008 23:16:42 +0000
(16:16 -0700)
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 <gitster@pobox.com>
Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
git-stash.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1b118da
)
diff --git
a/git-stash.sh
b/git-stash.sh
index e15c12abc31c1e4d22bb3943d70a65ddf33abb53..d799c763788ecd64b2508668f04c329b2de0c391 100755
(executable)
--- a/
git-stash.sh
+++ b/
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'