aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-10-22 11:38:58 -0700
committerJunio C Hamano <gitster@pobox.com>2025-10-22 11:38:58 -0700
commit98401c10fc9e991b36c4ccf5a270746f123feeb6 (patch)
tree83d4cb6fc595ed0db95d680c28178f8679e8af46 /builtin
parentMerge branch 'js/ci-github-actions-update' (diff)
parentt1010: use BROKEN_OBJECTS prerequisite (diff)
downloadgit-98401c10fc9e991b36c4ccf5a270746f123feeb6.tar.gz
git-98401c10fc9e991b36c4ccf5a270746f123feeb6.zip
Merge branch 'bc/sha1-256-interop-01'
The beginning of SHA1-SHA256 interoperability work. * bc/sha1-256-interop-01: t1010: use BROKEN_OBJECTS prerequisite t: allow specifying compatibility hash fsck: consider gpgsig headers expected in tags rev-parse: allow printing compatibility hash docs: add documentation for loose objects docs: improve ambiguous areas of pack format documentation docs: reflect actual double signature for tags docs: update offset order for pack index v3 docs: update pack index v3 format
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rev-parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 9da92b990d..7b3711cf34 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -1107,11 +1107,20 @@ int cmd_rev_parse(int argc,
const char *val = arg ? arg : "storage";
if (strcmp(val, "storage") &&
+ strcmp(val, "compat") &&
strcmp(val, "input") &&
strcmp(val, "output"))
die(_("unknown mode for --show-object-format: %s"),
arg);
- puts(the_hash_algo->name);
+
+ if (!strcmp(val, "compat")) {
+ if (the_repository->compat_hash_algo)
+ puts(the_repository->compat_hash_algo->name);
+ else
+ putchar('\n');
+ } else {
+ puts(the_hash_algo->name);
+ }
continue;
}
if (!strcmp(arg, "--show-ref-format")) {