summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-01-13 11:22:21 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-01-13 11:22:21 -0800
commit6845e8a62dca508819e9a95b9269054de8c7eda8 (patch)
tree3366596d645ff95ceb25bc3025fa1a83cad4b361 /t
parentpack-heuristics.txt: mark up the file header properly (diff)
parentcat-file: handle --batch format with missing type/size (diff)
downloadtgif-6845e8a62dca508819e9a95b9269054de8c7eda8.tar.xz
Merge branch 'jk/cat-file-regression-fix' into maint
"git cat-file --batch=", an admittedly useless command, did not behave very well. * jk/cat-file-regression-fix: cat-file: handle --batch format with missing type/size cat-file: pass expand_data to print_object_or_die
Diffstat (limited to 't')
-rwxr-xr-xt/t1006-cat-file.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index 8a1bc5c532..1687098355 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -85,6 +85,28 @@ $content"
git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
test_cmp expect actual
'
+
+ test -z "$content" ||
+ test_expect_success "--batch without type ($type)" '
+ {
+ echo "$size" &&
+ maybe_remove_timestamp "$content" $no_ts
+ } >expect &&
+ echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
+ maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+ test_cmp expect actual
+ '
+
+ test -z "$content" ||
+ test_expect_success "--batch without size ($type)" '
+ {
+ echo "$type" &&
+ maybe_remove_timestamp "$content" $no_ts
+ } >expect &&
+ echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
+ maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+ test_cmp expect actual
+ '
}
hello_content="Hello World"