aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-11-24 12:46:32 -0800
committerJunio C Hamano <gitster@pobox.com>2010-11-24 12:46:32 -0800
commite7b9b80e2f82319b80bf99d973463ef6d39e533c (patch)
tree5fac114d25e917c912fddaedd74309329393e16d /t
parent9cffe2018a8c400cbd50a8aec4eddea97c4ede2f (diff)
parent9130ac9fe17831445690ebbb60f09b86f96516b3 (diff)
downloadgit-e7b9b80e2f82319b80bf99d973463ef6d39e533c.tar.gz
git-e7b9b80e2f82319b80bf99d973463ef6d39e533c.tar.xz
Merge branch 'jk/maint-rev-list-nul' into maint
* jk/maint-rev-list-nul: rev-list: handle %x00 NUL in user format
Diffstat (limited to 't')
-rwxr-xr-xt/t4012-diff-binary.sh4
-rwxr-xr-xt/t6006-rev-list-format.sh8
-rw-r--r--t/test-lib.sh4
3 files changed, 12 insertions, 4 deletions
diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh
index bc46563af..05ec06283 100755
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
@@ -77,10 +77,6 @@ test_expect_success 'apply binary patch' \
tree1=`git write-tree` &&
test "$tree1" = "$tree0"'
-nul_to_q() {
- perl -pe 'y/\000/Q/'
-}
-
test_expect_success 'diff --no-index with binary creation' '
echo Q | q_to_nul >binary &&
(: hide error code from diff, which just indicates differences
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index cccacd4ad..d918cc02d 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -162,6 +162,14 @@ commit 131a310eb913d107dd3c09a65d1651175898735d
commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
EOF
+test_expect_success '%x00 shows NUL' '
+ echo >expect commit f58db70b055c5718631e5c61528b28b12090cdea &&
+ echo >>expect fooQbar &&
+ git rev-list -1 --format=foo%x00bar HEAD >actual.nul &&
+ nul_to_q <actual.nul >actual &&
+ test_cmp expect actual
+'
+
test_expect_success '%ad respects --date=' '
echo 2005-04-07 >expect.ad-short &&
git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 830e5e736..25f8bf95c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -248,6 +248,10 @@ test_decode_color () {
-e 's/.\[m/<RESET>/g'
}
+nul_to_q () {
+ perl -pe 'y/\000/Q/'
+}
+
q_to_nul () {
perl -pe 'y/Q/\000/'
}