diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-12-27 14:58:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-27 14:58:11 -0800 |
commit | 604ada435b78a473baa6962a90def78ccb186c58 (patch) | |
tree | ea714301bf443d2f381387e565dad9350b9440a3 /t/t1006-cat-file.sh | |
parent | 2b0a564e02528e006d23e3318d0d2869fb239425 (diff) | |
parent | 6554dfa97af92a159231d94e60403bfe0d6e8e61 (diff) | |
download | git-604ada435b78a473baa6962a90def78ccb186c58.tar.gz |
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-x | t/t1006-cat-file.sh | 22 |
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" |