diff options
| author | Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> | 2025-09-04 10:40:17 -0300 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-04 11:36:40 -0700 |
| commit | c2e3713334aa822683f046bbad7905ec8510d38b (patch) | |
| tree | 30c6518435c2895bb45946ea112699759c12beae /builtin/repo.c | |
| parent | repo: add the flag -z as an alias for --format=nul (diff) | |
| download | git-c2e3713334aa822683f046bbad7905ec8510d38b.tar.gz git-c2e3713334aa822683f046bbad7905ec8510d38b.zip | |
repo: add the field objects.format
The flag `--show-object-format` from git-rev-parse is used for
retrieving the object storage format. This way, it is used for
querying repository metadata, fitting in the purpose of git-repo-info.
Add a new field `objects.format` to the git-repo-info subcommand
containing that information.
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/repo.c')
| -rw-r--r-- | builtin/repo.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/repo.c b/builtin/repo.c index dc9a267469..bbb0966f2d 100644 --- a/builtin/repo.c +++ b/builtin/repo.c @@ -38,6 +38,12 @@ static int get_layout_shallow(struct repository *repo, struct strbuf *buf) return 0; } +static int get_object_format(struct repository *repo, struct strbuf *buf) +{ + strbuf_addstr(buf, repo->hash_algo->name); + return 0; +} + static int get_references_format(struct repository *repo, struct strbuf *buf) { strbuf_addstr(buf, @@ -49,6 +55,7 @@ static int get_references_format(struct repository *repo, struct strbuf *buf) static const struct field repo_info_fields[] = { { "layout.bare", get_layout_bare }, { "layout.shallow", get_layout_shallow }, + { "object.format", get_object_format }, { "references.format", get_references_format }, }; |
