Skip to content
Open
Prev Previous commit
Updated CsvReport.execute to support a project directory beneath the …
…Git root, preserving the subproject analysis scope.
  • Loading branch information
jimbethancourt committed Sep 29, 2026
commit f6f294c0902554af4def40fd6f8674cf10fb68ee
16 changes: 14 additions & 2 deletions report/src/main/java/org/hjug/refactorfirst/report/CsvReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hjug.refactorfirst.report.ReportWriter.writeReportToDisk;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.time.Instant;
import java.time.ZoneId;
Expand Down Expand Up @@ -71,8 +72,19 @@ public void execute(
}

String parentOfGitDir = gitDir.getParentFile().getPath();
Path gitRootPath = gitDir.getParentFile().toPath().toAbsolutePath().normalize();
Path projectBaseDirPath = Path.of(projectBaseDir).toAbsolutePath().normalize();
Path gitRootPath;
Path projectBaseDirPath;
try {
gitRootPath = gitDir.getParentFile().toPath().toRealPath();
projectBaseDirPath = Path.of(projectBaseDir).toRealPath();
} catch (IOException e) {
log.error(
"Error resolving project directory {} against Git repository root {}",
projectBaseDir,
parentOfGitDir,
e);
throw new RuntimeException(e);
}

log.info("Project Base Dir: {} ", projectBaseDir);
log.info("Parent of Git Dir: {}", parentOfGitDir);
Expand Down
Loading