![]() The NameConflictTreeWalk class is used in 3-way merge for iterating over entries in 3 different commits. The class provides information about a current entry and a state of the entry in commits (e.g entry is file, entry is directory, entry is missing). In rare cases, the tree walker can mix information about entries with different name. The problem appears, because git uses unusual sorting order for files. Example (this is a simplified real-life example): Commit 1: * gradle.properties - file * gradle - directory (with nested files) * gradle/file - file in gradle directory Commit 2: * gradle.properties - file * no entry with the name gradle Commit 3: * gradle.properties - file * gradle - file Here the names are ordered like this: "gradle" file <"gradle.properties" file < "gradle/file" file. NameConflictTreeWalk iterator already have code for processing git sorting order, however in the example above the code doesn't work correctly. Before the fix, NameConflictTreeWalk returns: #next() "gradle - directory" | "gradle.properties" | "gradle - file" - which is wrong. The expected result is #next() "gradle - directory | MISSED_FILE | "gradle - file" #next() "gradle.properties"|"gradle.properties"|"gradle.properties" Ensure that the "matches" field of tree iterators (which contains the current path) is kept in sync in the case above. Change-Id: Ief5aa06d80b358f4080043c8694aa0fd7c60045b Signed-off-by: Dmitrii Filippov <dmfilippov@google.com> |
||
---|---|---|
.. | ||
.settings | ||
META-INF | ||
findBugs | ||
resources/org/eclipse/jgit | ||
src/org/eclipse/jgit | ||
.classpath | ||
.fbprefs | ||
.gitignore | ||
.project | ||
BUILD | ||
about.html | ||
build.properties | ||
plugin.properties | ||
pom.xml |