1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-03-28 18:00:52 +01:00

Merge branch 'na/notes-displayref-is-not-boolean'

Config parser fix for "git notes".

* na/notes-displayref-is-not-boolean:
  t3301: test proper exit response to no-value notes.displayRef.
  notes.c: fix a segfault in notes_display_config()
This commit is contained in:
Junio C Hamano 2020-11-30 14:49:44 -08:00
commit e082a85708
2 changed files with 6 additions and 1 deletions

View File

@ -970,7 +970,7 @@ static int notes_display_config(const char *k, const char *v, void *cb)
if (*load_refs && !strcmp(k, "notes.displayref")) {
if (!v)
config_error_nonbool(k);
return config_error_nonbool(k);
string_list_add_refs_by_glob(&display_notes_refs, v);
}

View File

@ -672,6 +672,11 @@ test_expect_success 'notes.displayRef respects order' '
test_cmp expect-both-reversed actual
'
test_expect_success 'notes.displayRef with no value handled gracefully' '
test_must_fail git -c notes.displayRef log -0 --notes &&
test_must_fail git -c notes.displayRef diff-tree --notes HEAD
'
test_expect_success 'GIT_NOTES_DISPLAY_REF works' '
GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \
git log -2 >actual &&