Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--notes.c2
-rwxr-xr-xt/t3301-notes.sh5
2 files changed, 6 insertions, 1 deletions
diff --git a/notes.c b/notes.c
index 564baac64d..d5ac081e76 100644
--- a/notes.c
+++ b/notes.c
@@ -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);
}
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 8f43303007..ca60faf480 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -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 &&