Thread (57 messages) flat view 57 messages, 3 authors, 2016-11-20

Re: [PATCH v7 09/17] ref-filter: make "%(symref)" atom work with the ':short' modifier

From: Jakub Narębski <hidden>
Date: 2016-11-18 21:34:10

W dniu 08.11.2016 o 21:12, Karthik Nayak pisze:
[...]
 
Add tests for %(symref) and %(symref:short) while we're here.
That's nice.
Helped-by: Junio C Hamano [off-list ref]
Signed-off-by: Karthik Nayak <redacted>
---
[...]
+test_expect_success 'Add symbolic ref for the following tests' '
+	git symbolic-ref refs/heads/sym refs/heads/master
+'
+
+cat >expected <<EOF
+refs/heads/master
+EOF
This should be inside the relevant test, not outside.  In other
patches in this series you are putting setup together with the
rest of test, by using "cat >expected <<-\EOF".
+
+test_expect_success 'Verify usage of %(symref) atom' '
+	git for-each-ref --format="%(symref)" refs/heads/sym > actual &&
This should be spelled " >actual", rather than " > actual"; there
should be no space between redirection and file name.
+	test_cmp expected actual
+'
+
+cat >expected <<EOF
+heads/master
+EOF
+
+test_expect_success 'Verify usage of %(symref:short) atom' '
+	git for-each-ref --format="%(symref:short)" refs/heads/sym > actual &&
+	test_cmp expected actual
+'
Same here.
+
 test_done
-- 
Jakub Narębski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help