mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: do not apply single change multiple times
When calling "Apply all" we collect both changes in pair. But while applying first change we'll apply second one too. So the second change will be already applied at the time it processed.
This commit is contained in:
+10
@@ -8,6 +8,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class NoConflictChange extends TwoSideChange.SideChange<MergeNoConflict> {
|
||||
private static final Logger LOG = Logger.getInstance(NoConflictChange.class);
|
||||
|
||||
private boolean myApplied;
|
||||
|
||||
public NoConflictChange(@NotNull MergeNoConflict twoSideChange,
|
||||
@NotNull FragmentSide mergeSide,
|
||||
@NotNull TextRange baseRange,
|
||||
@@ -24,4 +26,12 @@ public class NoConflictChange extends TwoSideChange.SideChange<MergeNoConflict>
|
||||
LOG.assertTrue(otherChange != null, String.format("Other change is null. This change: %s Merge conflict: %s", this, myTwoSideChange));
|
||||
otherChange.markApplied();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void markApplied() {
|
||||
if (!myApplied) {
|
||||
myApplied = true;
|
||||
super.markApplied();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user