]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/rev-parse.c
Merge branch 'bc/hash-independent-tests-part-6'
[thirdparty/git.git] / builtin / rev-parse.c
index 308c67e4fc668ec59343bbaba210b505c90a9e2c..85ce2095bf21cb386dd9577823139da01f0d0967 100644 (file)
@@ -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;