Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-11-10 12:02:17 +0300
committerJunio C Hamano <gitster@pobox.com>2019-11-10 12:02:17 +0300
commit28014c1084c0180c71af9ffaaca82a57e48b76b5 (patch)
treed646687b3d027dffcd0d998493a843ea7d41e5d6 /builtin/rev-parse.c
parent57b530125e022de79f5f0b208bc0a5ee67c18b77 (diff)
parentfa26d5ede6e6c2a07590d3564efc1f92f82fcc0f (diff)
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.c11
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;