Skip to content

Commit

Permalink
Auto appending commit file path from repo root instead of execution dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim-Durand committed Apr 6, 2024
1 parent 335fadb commit 176b462
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,17 @@ export default class Git {
includeMergeCommitFiles: true,
});

const repoRootPath = execSync("git rev-parse --show-toplevel", {

Check failure on line 382 in packages/core/src/git.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'execSync'.
encoding: "utf8",
}).trim();

return log
.map((commit) => ({
hash: commit.hash,
authorName: commit.authorName,
authorEmail: commit.authorEmail,
subject: commit.rawBody!,
files: (commit.files || []).map((file) => path.resolve(file)),
files: (commit.files || []).map((file) => path.resolve(repoRootPath,file)),
}))
.reduce<ICommit[]>((all, commit) => {
// The -m option will list a commit for each merge parent. This
Expand Down

0 comments on commit 176b462

Please sign in to comment.