git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re*: Peculiar behavior of git 1.5.6

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Sep 4, 2008, 10:20 UTC
Message-ID
<20080904192008.6117@nanako3.lavabit.com>
In-Reply-To
<7v3akg5jul.fsf_-_@gitster.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>:
Show 9 quoted lines
> 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@pobox.com>
Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
Show 32 quoted lines
> ---
>  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/
Previous: Junio C HamanoNext: Larry Finger
Message 6 of 7 in “Peculiar behavior of git 1.5.6”
  1. Larry FingerSep 4, 2008
  2. Johannes SixtSep 4, 2008
  3. Junio C HamanoSep 4, 2008
  4. Jonathan del StrotherSep 4, 2008
  5. Re*: Peculiar behavior of git 1.5.6Junio C Hamano, Sep 4, 2008
  6. Nanako ShiraishiSep 4, 2008
  7. Larry FingerSep 4, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.