]> source.dussan.org Git - jgit.git/commit
DirCache: Do not create duplicate tree entries 81/62981/13
authorShawn Pearce <spearce@spearce.org>
Fri, 18 Dec 2015 22:31:20 +0000 (14:31 -0800)
committerShawn Pearce <spearce@spearce.org>
Tue, 29 Dec 2015 19:33:39 +0000 (11:33 -0800)
commit683c41af92d248c818dcddb4d86c1640eba79374
tree160d044601a191dc725a8dca24f92056978e106b
parentb71ba69410db5e50dd10c5c40e96699c9de7e5e8
DirCache: Do not create duplicate tree entries

If a file (e.g.  "A") and a subtree file (e.g. "A/foo.c") both appear
in the DirCache this cache should not be written out as a tree object.
The "A" file and "A" subtree conflict with each other in the same tree
and will fail fsck.

Detect this condition during DirCacheBuilder and DirCacheEditor
finish() so the application can be halted early before it updates a
DirCache that might later write an invalid tree structure.

Change-Id: I95660787e88df336297949b383f4c5fda52e75f5
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/BaseDirCacheEditor.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/DirCacheNameConflictException.java [new file with mode: 0644]