|
|
@ -52,12 +52,14 @@ import org.eclipse.jgit.api.ResetCommand.ResetType; |
|
|
|
import org.eclipse.jgit.api.errors.GitAPIException; |
|
|
|
import org.eclipse.jgit.api.errors.GitAPIException; |
|
|
|
import org.eclipse.jgit.api.errors.JGitInternalException; |
|
|
|
import org.eclipse.jgit.api.errors.JGitInternalException; |
|
|
|
import org.eclipse.jgit.api.errors.NoHeadException; |
|
|
|
import org.eclipse.jgit.api.errors.NoHeadException; |
|
|
|
|
|
|
|
import org.eclipse.jgit.api.errors.UnmergedPathsException; |
|
|
|
import org.eclipse.jgit.dircache.DirCache; |
|
|
|
import org.eclipse.jgit.dircache.DirCache; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor.DeletePath; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor.DeletePath; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEntry; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheEntry; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheIterator; |
|
|
|
import org.eclipse.jgit.dircache.DirCacheIterator; |
|
|
|
|
|
|
|
import org.eclipse.jgit.errors.UnmergedPathException; |
|
|
|
import org.eclipse.jgit.internal.JGitText; |
|
|
|
import org.eclipse.jgit.internal.JGitText; |
|
|
|
import org.eclipse.jgit.lib.CommitBuilder; |
|
|
|
import org.eclipse.jgit.lib.CommitBuilder; |
|
|
|
import org.eclipse.jgit.lib.Constants; |
|
|
|
import org.eclipse.jgit.lib.Constants; |
|
|
@ -247,6 +249,10 @@ public class StashCreateCommand extends GitCommand<RevCommit> { |
|
|
|
WorkingTreeIterator wtIter = treeWalk.getTree(2, |
|
|
|
WorkingTreeIterator wtIter = treeWalk.getTree(2, |
|
|
|
WorkingTreeIterator.class); |
|
|
|
WorkingTreeIterator.class); |
|
|
|
if (headIter != null && indexIter != null && wtIter != null) { |
|
|
|
if (headIter != null && indexIter != null && wtIter != null) { |
|
|
|
|
|
|
|
if (!indexIter.getDirCacheEntry().isMerged()) |
|
|
|
|
|
|
|
throw new UnmergedPathsException( |
|
|
|
|
|
|
|
new UnmergedPathException( |
|
|
|
|
|
|
|
indexIter.getDirCacheEntry())); |
|
|
|
if (wtIter.idEqual(indexIter) |
|
|
|
if (wtIter.idEqual(indexIter) |
|
|
|
|| wtIter.idEqual(headIter)) |
|
|
|
|| wtIter.idEqual(headIter)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|