Thread (18 messages) flat view 18 messages, 5 authors, 2018-12-28

Re: [PATCH v1 2/2] log -S: Add test which searches in binary files

From: Thomas Braun <hidden>
Date: 2018-11-28 11:31:19

Ævar Arnfjörð Bjarmason [off-list ref] hat am 22. November 2018 um 10:14 geschrieben:



On Wed, Nov 21 2018, Thomas Braun wrote:
quoted
The -S <regex> option of log looks for differences that changes the
number of occurrences of the specified string (i.e. addition/deletion)
in a file.

Add a test to ensure that we keep looking into binary files with -S
as changing that would break backwards compatibility in unexpected ways.

Signed-off-by: Thomas Braun <redacted>
---
 t/t4209-log-pickaxe.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh
index 42cc8afd8b..d430f6f2f9 100755
--- a/t/t4209-log-pickaxe.sh
+++ b/t/t4209-log-pickaxe.sh
@@ -128,4 +128,15 @@ test_expect_success 'log -G looks into binary files with textconv filter' '
 	test_cmp actual expected
 '

+test_expect_success 'log -S looks into binary files' '
+	rm -rf .git &&
+	git init &&
+	printf "a\0b" >data.bin &&
+	git add data.bin &&
+	git commit -m "message" &&
+	git log -S a >actual &&
+	git log >expected &&
+	test_cmp actual expected
+'
+
 test_done
This should just be part of 1/2 since the behavior is changed there &
the commit message should describe both cases.
My reasoning was that this is a separate test which does not fit in with the other part.
But I'm happy in folding both into one patch. Done.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help