diff options
author | Victoria Dye <vdye@github.com> | 2025-06-02 18:55:55 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-06-03 12:08:58 -0700 |
commit | b0b910e052b2c5a8036343c0475dbbb01add6be8 (patch) | |
tree | b97adf8e2a2e2da7f860278dd35501523e415913 /builtin/commit-graph.c | |
parent | aba14384354c6f722c127962bc756a542078f3e3 (diff) |
cat-file.c: add batch handling for submodules
When an object specification is passed to 'cat-file --batch[-check]'
referring to a submodule (e.g. 'HEAD:path/to/my/submodule'), the current
behavior of the command is to print the "missing" error message. However, it
is often valuable for callers to distinguish between paths that are actually
missing and "the submodule tree entry exists, but the object does not exist
in the repository".
To disambiguate without needing to invoke a separate Git process (e.g.
'ls-tree'), print the message "<oid> submodule" for such objects instead of
"<object> missing". In addition to the change from "missing" to "submodule",
the new message differs from the old in that it always prints the resolved
tree entry's OID, rather than the input object specification.
Note that this implementation maintains a distinction between submodules
where the commit OID is not present in the repo, and submodules where the
commit OID *is* present; the former will now print "<object> submodule", but
the latter will still print the full object content.
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
0 files changed, 0 insertions, 0 deletions