Re: Re*: Peculiar behavior of git 1.5.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Junio C Hamano <gitster@xxxxxxxxx>:

> 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 <gitster@xxxxxxxxx>

Acked-by: Nanako Shiraishi <nanako3@xxxxxxxxxxx>

> ---
>  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/

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux