From 1b7884e26f2a259f381dce51bd9bb373db04ea4b Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Mon, 10 Apr 2017 00:22:23 +0300 Subject: [PATCH] [vcs-log] changed and moved paths are mutually exclusive --- .../vcs/log/impl/VcsChangesLazilyParsedDetails.java | 6 ++++-- plugins/git4idea/src/git4idea/GitCommit.java | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsChangesLazilyParsedDetails.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsChangesLazilyParsedDetails.java index 391037a4db18..260aed07ca32 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsChangesLazilyParsedDetails.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsChangesLazilyParsedDetails.java @@ -66,8 +66,10 @@ public class VcsChangesLazilyParsedDetails extends VcsCommitMetadataImpl impleme public Collection getModifiedPaths() { Set changedPaths = ContainerUtil.newHashSet(); for (Change change : getChanges()) { - if (change.getAfterRevision() != null) changedPaths.add(change.getAfterRevision().getFile().getPath()); - if (change.getBeforeRevision() != null) changedPaths.add(change.getBeforeRevision().getFile().getPath()); + if (!change.getType().equals(Change.Type.MOVED)) { + if (change.getAfterRevision() != null) changedPaths.add(change.getAfterRevision().getFile().getPath()); + if (change.getBeforeRevision() != null) changedPaths.add(change.getBeforeRevision().getFile().getPath()); + } } return changedPaths; } diff --git a/plugins/git4idea/src/git4idea/GitCommit.java b/plugins/git4idea/src/git4idea/GitCommit.java index 0da5f8f4778c..e26546227422 100644 --- a/plugins/git4idea/src/git4idea/GitCommit.java +++ b/plugins/git4idea/src/git4idea/GitCommit.java @@ -58,10 +58,8 @@ public final class GitCommit extends VcsChangesLazilyParsedDetails { if (data != null) { Set changes = ContainerUtil.newHashSet(); for (GitLogStatusInfo status : ((MyChangesComputable)myChangesGetter).getMergedChanges()) { - changes.add(absolutePath(status.getFirstPath())); - String secondPath = status.getSecondPath(); - if (secondPath != null) { - changes.add(absolutePath(secondPath)); + if (status.getSecondPath() == null) { + changes.add(absolutePath(status.getFirstPath())); } } return changes;