Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-28 02:58:11 +0400
committerJunio C Hamano <gitster@pobox.com>2013-12-28 02:58:11 +0400
commit604ada435b78a473baa6962a90def78ccb186c58 (patch)
treeea714301bf443d2f381387e565dad9350b9440a3 /t/t1006-cat-file.sh
parent2b0a564e02528e006d23e3318d0d2869fb239425 (diff)
parent6554dfa97af92a159231d94e60403bfe0d6e8e61 (diff)
Merge branch 'jk/cat-file-regression-fix'
"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/t1006-cat-file.sh')
-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"