1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-03 13:26:29 +02:00

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 <gitster@pobox.com>
Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
This commit is contained in:
Junio C Hamano 2008-09-04 02:41:22 -07:00
parent 1b118da8bd
commit 1eff26c0e2

View File

@ -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'