cat-file: introduce batch_mode enum to replace print_contents
commitac4e58cab9a946d4c45f1db5ee7c79b6fb14bd67
authorJohn Cai <johncai86@gmail.com>
Fri, 18 Feb 2022 18:23:12 +0000 (18 18:23 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Feb 2022 19:21:46 +0000 (18 11:21 -0800)
tree5dd34db257e0cfc2d02d6de65e4442b89822337c
parenta2c75526d21939d5d4e36dbbd6093a5e2c14c39f
cat-file: introduce batch_mode enum to replace print_contents

A future patch introduces a new --batch-command flag. Including --batch
and --batch-check, we will have a total of three batch modes. print_contents
is the only boolean on the batch_options sturct used to distinguish
between the different modes. This makes the code harder to read.

To reduce potential confusion, replace print_contents with an enum to
help readability and clarity.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c