Skip to content

Commit 33be5ab

Browse files
committed
fix(cli): tweaks for core.commentChar handling (conventional-changelog#3190)
- Remove useless change to test git repository setup - Add comment on git config error handling
1 parent 481478c commit 33be5ab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

@commitlint/cli/src/cli.ts

+2
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ async function main(args: MainArgs) {
232232
opts.parserOpts.commentChar = stdout.trim() || gitDefaultCommentChar;
233233
} catch (e) {
234234
const execaError = e as ExecaError;
235+
// git config returns exit code 1 when the setting is unset,
236+
// don't warn in this case.
235237
if (!execaError.failed || execaError.exitCode !== 1) {
236238
console.warn(
237239
'Could not determine core.commentChar git configuration',

@packages/test/src/git.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ async function setup(cwd: string, gitCommand = 'git') {
3535
cwd,
3636
});
3737
await execa(gitCommand, ['config', 'commit.gpgsign', 'false'], {cwd});
38-
await execa(gitCommand, ['config', 'core.commentChar', '#'], {cwd});
3938
} catch (err: any) {
4039
if (typeof err === 'object' && typeof err.message === 'object') {
4140
console.warn(`git config in ${cwd} failed`, err.message);

0 commit comments

Comments
 (0)