]> git.ipfire.org Git - thirdparty/git.git/commit
test-lib-functions: add commit_body helper
authorShlok Kulshreshtha <diy2903@gmail.com>
Mon, 27 Jul 2026 09:56:55 +0000 (15:26 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2026 19:58:37 +0000 (12:58 -0700)
commita592d6feb3d47a1fcd6be5b4c8136e116c26ffbc
tree05f9d73a9e5820d14cb098ff09b925c4ded9c185
parent9a0c4701dcd5725c4184599322b52933ff5005ca
test-lib-functions: add commit_body helper

Extracting the message body of a commit -- running "git cat-file commit"
and stripping everything up to and including the first blank line with
"sed" -- is spelled out in about 60 places across the test suite.

Add a helper for it, so that the operation is written once instead of
being copied around.

The commit object goes to a temporary file rather than into a pipe,
because a pipeline reports only its last command's exit status, so a
failure of "git cat-file" would go unnoticed.

Signed-off-by: Shlok Kulshreshtha <diy2903@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/README
t/test-lib-functions.sh