Skip to content

Commit 8855a9b

Browse files
martinschaefMartin Schaef
andauthored
Fixing java.nio.file.NoSuchFileException (#26)
Co-authored-by: Martin Schaef <[email protected]>
1 parent d3476f5 commit 8855a9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/amazonaws/gurureviewercli/adapter/GitAdapter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ private static Collection<Path> getChangedFiles(final Repository repository) thr
111111
if (treeWalk.isSubtree()) {
112112
treeWalk.enterSubtree();
113113
} else {
114-
val normalizedPath = rootDir.resolve(treeWalk.getPathString()).toRealPath();
115-
allFiles.add(normalizedPath);
114+
val normalizedFile = rootDir.resolve(treeWalk.getPathString()).toFile().getCanonicalFile();
115+
if (normalizedFile.isFile()) {
116+
allFiles.add(normalizedFile.toPath());
117+
}
116118
}
117119
}
118120
return allFiles;

0 commit comments

Comments
 (0)