Re: [BUG] Bug in git stash

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

 



Am 1/14/2013 10:18, schrieb Nikolay Frantsev:
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #	new file:   3
> #
> # Changes not staged for commit:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working directory)
> #
> #	modified:   1
> #	modified:   2
> #
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git stash save --keep-index one
> Saved working directory and index state On master: one
> HEAD is now at 7e495f9 files added
...
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git stash pop stash@{1}
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #	new file:   3
> #
> # Changes not staged for commit:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working directory)
> #
> #	modified:   1
> #	modified:   2
> #
> Dropped stash@{1} (7926ab7285753c179a368a3a7e8ebfb0f39d0437)
> 
> Why there a new empty file named 3?

It is by design. --keep-index only achieves that your staged changes are
not reverted, but nevertheless all changes are stashed away. Therefore,
when you later apply the stash, you also get back the modified index.

-- Hannes
--
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]