mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[patch]: IDEA-146642 unexpected mapping on applying a VCS patch
* tests added
This commit is contained in:
@@ -89,7 +89,7 @@ public class MatchPatchPaths {
|
||||
for (VirtualFile file : files) {
|
||||
Pair<VirtualFile, Integer> pair = compareNamesImpl(strings, file, i);
|
||||
if (pair != null && pair.getSecond() < i) {
|
||||
if (best == null || pair.getSecond() < best.getSecond()) {
|
||||
if (best == null || pair.getSecond() < best.getSecond() || isGoodAndProjectBased(best, pair)) {
|
||||
best = pair;
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,10 @@ public class MatchPatchPaths {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isGoodAndProjectBased(@NotNull Pair<VirtualFile, Integer> best, @NotNull Pair<VirtualFile, Integer> pair) {
|
||||
return pair.getSecond().equals(best.getSecond()) && myBaseDir.equals(pair.getFirst());
|
||||
}
|
||||
|
||||
private static void selectByContextOrByStrip(@NotNull List<PatchAndVariants> candidates,
|
||||
@NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress> result) {
|
||||
for (final PatchAndVariants candidate : candidates) {
|
||||
|
||||
Reference in New Issue
Block a user