From: Junio C Hamano Date: Thu, 30 Jul 2026 17:40:43 +0000 (-0700) Subject: Merge branch 'jk/cat-file-batch-wo-type-fix' into jch X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=182a8044cce8a869c48fbdaff18eb5f6f89c4b6d;p=thirdparty%2Fgit.git Merge branch 'jk/cat-file-batch-wo-type-fix' into jch "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 --- 182a8044cce8a869c48fbdaff18eb5f6f89c4b6d diff --cc t/t1006-cat-file.sh index 0c1dc0fb40,d0db1f2a29..72fc8acc61 --- a/t/t1006-cat-file.sh +++ b/t/t1006-cat-file.sh @@@ -1337,9 -1348,17 +1337,17 @@@ test_expect_success 'batch-command flus test_expect_success 'batch-command flush without --buffer' ' echo "flush" >cmd && test_expect_code 128 git cat-file --batch-command 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;