Skip to content

Commit

Permalink
fix(release): use --first-parent to support merged repos (nrwl#21686)
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj authored Feb 13, 2024
1 parent ca90764 commit a045b3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/nx/src/command-line/release/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ export async function getCommitHash(ref: string) {
export async function getFirstGitCommit() {
try {
return (
await execCommand('git', ['rev-list', '--max-parents=0', 'HEAD'])
await execCommand('git', [
'rev-list',
'--max-parents=0',
'HEAD',
'--first-parent',
])
).trim();
} catch (e) {
throw new Error(`Unable to find first commit in git history`);
Expand Down

0 comments on commit a045b3f

Please sign in to comment.