[PATCH 1/2] t3301-notes: check editor isn't invoked for empty notes add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



90bc19b3ae ("notes.c: introduce '--separator=<paragraph-break>' option")
changed note_data.given logic such that it's no longer set if a zero
length file or blob object is provided.

Add a test for this regression by checking whether GIT_EDITOR is
invoked.

Signed-off-by: David Disseldorp <ddiss@xxxxxxx>
---
 t/t3301-notes.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 536bd11ff4..c0dbacc161 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1557,4 +1557,9 @@ test_expect_success 'empty notes are displayed by git log' '
 	test_cmp expect actual
 '
 
+test_expect_success 'empty notes do not invoke the editor' '
+	test_commit 18th &&
+	GIT_EDITOR="false" git notes add -C "$empty_blob" --allow-empty
+'
+
 test_done
-- 
2.43.0





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux