1. Stefan Saasen
  2. git


Junio C Hamano  committed 1eff26c

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>

  • Participants
  • Parent commits 1b118da
  • Branches master

Comments (0)

Files changed (1)

File git-stash.sh

View file
 create_stash () {
+	git update-index -q --refresh
 	if no_changes
 		exit 0
+	git update-index -q --refresh
 	if no_changes
 		echo 'No local changes to save'
 apply_stash () {
+	git update-index -q --refresh &&
 	git diff-files --quiet --ignore-submodules ||
 		die 'Cannot restore on top of a dirty state'