diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-11-10 18:02:17 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-11-10 18:02:17 +0900 |
commit | 28014c1084c0180c71af9ffaaca82a57e48b76b5 (patch) | |
tree | d646687b3d027dffcd0d998493a843ea7d41e5d6 /builtin/rev-parse.c | |
parent | Merge branch 'js/update-index-ignore-removal-for-skip-worktree' (diff) | |
parent | t4048: abstract away SHA-1-specific constants (diff) | |
download | tgif-28014c1084c0180c71af9ffaaca82a57e48b76b5.tar.xz |
Merge branch 'bc/hash-independent-tests-part-6'
Test updates to prepare for SHA-2 transition continues.
* bc/hash-independent-tests-part-6:
t4048: abstract away SHA-1-specific constants
t4045: make hash-size independent
t4044: update test to work with SHA-256
t4039: abstract away SHA-1-specific constants
t4038: abstract away SHA-1 specific constants
t4034: abstract away SHA-1-specific constants
t4027: make hash-size independent
t4015: abstract away SHA-1-specific constants
t4011: abstract away SHA-1-specific constants
t4010: abstract away SHA-1-specific constants
t3429: remove SHA1 annotation
t1305: avoid comparing extensions
rev-parse: add a --show-object-format option
t/oid-info: add empty tree and empty blob values
t/oid-info: allow looking up hash algorithm name
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r-- | builtin/rev-parse.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 308c67e4fc..85ce2095bf 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -919,6 +919,17 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) show_datestring("--min-age=", arg); continue; } + if (opt_with_value(arg, "--show-object-format", &arg)) { + const char *val = arg ? arg : "storage"; + + if (strcmp(val, "storage") && + strcmp(val, "input") && + strcmp(val, "output")) + die("unknown mode for --show-object-format: %s", + arg); + puts(the_hash_algo->name); + continue; + } if (show_flag(arg) && verify) die_no_single_rev(quiet); continue; |