aboutsummaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-11-19 10:55:39 -0800
committerJunio C Hamano <gitster@pobox.com>2025-11-19 10:55:39 -0800
commit13134cecb08604fc2a4d30b6f9f941f6323e6de2 (patch)
tree09662dd0be0a1befe13e1f63e511704f175400b8 /object.h
parent7a75e549b29cfe7b4f0279625298649a28edc110 (diff)
parent61ac8ba0f034b61d7353a799fecae9fe45137a72 (diff)
downloadgit-13134cecb08604fc2a4d30b6f9f941f6323e6de2.tar.xz
Merge branch 'ps/ref-peeled-tags'
Some ref backend storage can hold not just the object name of an annotated tag, but the object name of the object the tag points at. The code to handle this information has been streamlined. * ps/ref-peeled-tags: t7004: do not chdir around in the main process ref-filter: fix stale parsed objects ref-filter: parse objects on demand ref-filter: detect broken tags when dereferencing them refs: don't store peeled object IDs for invalid tags object: add flag to `peel_object()` to verify object type refs: drop infrastructure to peel via iterators refs: drop `current_ref_iter` hack builtin/show-ref: convert to use `reference_get_peeled_oid()` ref-filter: propagate peeled object ID upload-pack: convert to use `reference_get_peeled_oid()` refs: expose peeled object ID via the iterator refs: refactor reference status flags refs: fully reset `struct ref_iterator::ref` on iteration refs: introduce `.ref` field for the base iterator refs: introduce wrapper struct for `each_ref_fn`
Diffstat (limited to 'object.h')
-rw-r--r--object.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/object.h b/object.h
index fa504a09c0..fd15eecce8 100644
--- a/object.h
+++ b/object.h
@@ -288,6 +288,17 @@ enum peel_status {
PEEL_BROKEN = -4
};
+enum peel_object_flags {
+ /*
+ * Always verify the object type, even in the case where the looked-up
+ * object already has an object type. This can be useful when the
+ * stored object type may be invalid. One such case is when looking up
+ * objects via tags, where we blindly trust the object type declared by
+ * the tag.
+ */
+ PEEL_OBJECT_VERIFY_OBJECT_TYPE = (1 << 0),
+};
+
/*
* Peel the named object; i.e., if the object is a tag, resolve the
* tag recursively until a non-tag is found. If successful, store the
@@ -296,7 +307,9 @@ enum peel_status {
* and leave oid unchanged.
*/
enum peel_status peel_object(struct repository *r,
- const struct object_id *name, struct object_id *oid);
+ const struct object_id *name,
+ struct object_id *oid,
+ unsigned flags);
struct object_list *object_list_insert(struct object *item,
struct object_list **list_p);