Skip to content

Commit

Permalink
resources/utils: fix git().revList
Browse files Browse the repository at this point in the history
Context: broke changelog generation in case of empty list since it returned
`['']` instead of `[]`
  • Loading branch information
IvanGoncharov committed Oct 19, 2022
1 parent f851eba commit 45c36ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export function git(options?: GITOptions) {
},
revList(...args: ReadonlyArray<string>): Array<string> {
const allArgs = ['rev-list', ...cmdOptions, ...args];
return spawnOutput('git', allArgs, options).split('\n');
const result = spawnOutput('git', allArgs, options);
return result === '' ? [] : result.split('\n');
},
catFile(...args: ReadonlyArray<string>): string {
return spawnOutput('git', ['cat-file', ...cmdOptions, ...args], options);
Expand Down

0 comments on commit 45c36ac

Please sign in to comment.