[vcs-log] changed and moved paths are mutually exclusive

This commit is contained in:
Julia Beliaeva
2017-06-04 23:29:08 +03:00
parent ad2309b009
commit 1b7884e26f
2 changed files with 6 additions and 6 deletions
@@ -66,8 +66,10 @@ public class VcsChangesLazilyParsedDetails extends VcsCommitMetadataImpl impleme
public Collection<String> getModifiedPaths() {
Set<String> 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;
}
+2 -4
View File
@@ -58,10 +58,8 @@ public final class GitCommit extends VcsChangesLazilyParsedDetails {
if (data != null) {
Set<String> 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;