Skip to content

Commit 8cf85f6

Browse files
committed
fix: always export path in linegraphs in unix style for OS interoperability
1 parent 27493a4 commit 8cf85f6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/variantsync/diffdetective/diff/difftree/serialize/treeformat/CommitDiffDiffTreeLabelFormat.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.variantsync.diffdetective.diff.difftree.serialize.treeformat;
22

3+
import org.apache.commons.io.FilenameUtils;
34
import org.variantsync.diffdetective.diff.CommitDiff;
45
import org.variantsync.diffdetective.diff.PatchDiff;
56
import org.variantsync.diffdetective.diff.difftree.CommitDiffDiffTreeSource;
@@ -32,10 +33,10 @@ public DiffTreeSource fromLabel(final String label) {
3233
public String toLabel(final DiffTreeSource diffTreeSource) {
3334
if (diffTreeSource instanceof CommitDiffDiffTreeSource commitDiffDiffTreeSource) {
3435
// write for instances of CommitDiffDiffTreeSources
35-
return commitDiffDiffTreeSource.getFileName() + LineGraphConstants.TREE_NAME_SEPARATOR + commitDiffDiffTreeSource.getCommitHash();
36+
return FilenameUtils.separatorsToUnix(commitDiffDiffTreeSource.getFileName().toString()) + LineGraphConstants.TREE_NAME_SEPARATOR + commitDiffDiffTreeSource.getCommitHash();
3637
} else if (diffTreeSource instanceof PatchDiff patchDiff) {
3738
// write for instances of PatchDiffs
38-
return patchDiff.getFileName() + LineGraphConstants.TREE_NAME_SEPARATOR + patchDiff.getCommitDiff().getCommitHash();
39+
return FilenameUtils.separatorsToUnix(patchDiff.getFileName()) + LineGraphConstants.TREE_NAME_SEPARATOR + patchDiff.getCommitDiff().getCommitHash();
3940
} else {
4041
throw new UnsupportedOperationException("There is no implementation for this DiffTreeSource type: " + diffTreeSource);
4142
}

0 commit comments

Comments
 (0)