]> source.dussan.org Git - jgit.git/commit
Only unstash files changed when originally stashed 94/5194/8
authorKevin Sawicki <kevin@github.com>
Wed, 14 Mar 2012 00:01:42 +0000 (17:01 -0700)
committerChris Aniszczyk <zx@twitter.com>
Wed, 14 Mar 2012 00:14:15 +0000 (19:14 -0500)
commit9be6526e9dbcfaca168dd66caac36a9316d44d88
tree358e1d8a778116e11eac7ce75c383a832fbc00c9
parent6e13dfab4a2ea6a264abacd49ed36cbfa3dba128
Only unstash files changed when originally stashed

Previously a DirCacheCheckout was done using a merge tree reflecting
the state of the repository when the stash was originally done.
This was wrong since unstashing after making subsequent commits
would undo changes already committed by checking out entries from
an outdated tree.

The new approach is to scan for conflicts initially using a 6-way
tree walk that contains the trees for the stashed HEAD, stashed
index, stashed working directory, current HEAD, current index, and
current working directory.  Then perform a subsequent scan of the
stashed HEAD, index, and working directory trees and apply all
the stashed differences to the current index and working directory.

Bug: 372882
Change-Id: Ica65f162132c00a16964e838de66fc8b5cd0b0aa
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java