diff options
| author | Patrick Steinhardt <ps@pks.im> | 2023-12-29 08:27:00 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-02 09:24:48 -0800 |
| commit | 3c4a5318afb4978a037c83ccd9bbeb870b3f0543 (patch) | |
| tree | 9414b55f9bc66507e0cc70431418b556549ac113 /builtin/rev-parse.c | |
| parent | t: introduce GIT_TEST_DEFAULT_REF_FORMAT envvar (diff) | |
| download | git-3c4a5318afb4978a037c83ccd9bbeb870b3f0543.tar.gz git-3c4a5318afb4978a037c83ccd9bbeb870b3f0543.zip | |
builtin/rev-parse: introduce `--show-ref-format` flag
Introduce a new `--show-ref-format` to git-rev-parse(1) that causes it
to print the ref format used by a repository.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-parse.c')
| -rw-r--r-- | builtin/rev-parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 917f122440..d08987646a 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -1062,6 +1062,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) puts(the_hash_algo->name); continue; } + if (!strcmp(arg, "--show-ref-format")) { + puts(ref_storage_format_to_name(the_repository->ref_storage_format)); + continue; + } if (!strcmp(arg, "--end-of-options")) { seen_end_of_options = 1; if (filter & (DO_FLAGS | DO_REVS)) |
