return 0;
}
if (!strcmp(var, "format.commitlistformat")) {
- struct strbuf tmp = STRBUF_INIT;
- strbuf_init(&tmp, 0);
- if (value)
- strbuf_addstr(&tmp, value);
- else
- strbuf_addstr(&tmp, "log:[%(count)/%(total)] %s");
-
FREE_AND_NULL(cfg->fmt_cover_letter_commit_list);
- git_config_string(&cfg->fmt_cover_letter_commit_list, var, tmp.buf);
- strbuf_release(&tmp);
- return 0;
+ return git_config_string(&cfg->fmt_cover_letter_commit_list, var, value);
}
if (!strcmp(var, "format.outputdirectory")) {
FREE_AND_NULL(cfg->config_output_directory);
test_line_count = 2 result
'
-test_expect_success 'cover letter config commitlistformat set but no format' '
- test_when_finished "rm -rf patches result" &&
- test_when_finished "git config unset format.coverletter" &&
- test_when_finished "git config unset format.commitlistformat" &&
- git config set format.coverletter true &&
- printf "\tcommitlistformat" >> .git/config &&
- git format-patch -o patches HEAD~2 &&
- grep -E "^[[[:digit:]]+/[[:digit:]]+] .*" patches/0000-cover-letter.patch >result &&
- test_line_count = 2 result
-'
-
test_expect_success 'cover letter config commitlistformat set to shortlog' '
test_when_finished "rm -rf patches result" &&
test_when_finished "git config unset format.coverletter" &&