Skip to content

Commit

Permalink
SLCORE-927 Fix git utils (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-knize-sonarsource authored Nov 4, 2024
1 parent 427d4d6 commit 9b4a164
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ public static SonarLintBlameResult blameWithFilesGitCommand(Path projectBaseDir,
}
}

private static Path getRelativePath(Repository gitRepo, Path projectBaseDir) {
var repoDir = gitRepo.isBare() ? gitRepo.getDirectory() : gitRepo.getWorkTree();
return repoDir.toPath().relativize(projectBaseDir);
}

public static Repository buildGitRepository(Path basedir) {
try {
var repositoryBuilder = new RepositoryBuilder()
Expand Down

0 comments on commit 9b4a164

Please sign in to comment.