"git cat-file --batch-command" that asked for 'contents' without
'type' segfaults, which has been corrected.
* jk/cat-file-batch-wo-type-fix:
cat-file: handle content request for --batch-command without type
test_expect_success 'batch-command flush without --buffer' '
echo "flush" >cmd &&
test_expect_code 128 git cat-file --batch-command <cmd 2>err &&
- grep "^fatal:.*flush is only for --buffer mode.*" err
+ test_grep "^fatal:.*flush is only for --buffer mode.*" err
'
+ test_expect_success 'batch-command contents auto-handles type' '
+ echo "HEAD" |
+ git cat-file --batch="%(objectname)" >expect &&
+ echo "contents HEAD" |
+ git cat-file --batch-command="%(objectname)" >actual &&
+ test_cmp expect actual
+ '
+
perl_script='
use warnings;
use strict;