summaryrefslogtreecommitdiff
path: root/fsck.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-10-18 04:57:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-28 05:05:18 (GMT)
commit733902905d4db54612fef9755bb31fd35a89e76c (patch)
tree4296300d056b40a89692c756c5ba905f7ea1d3d5 /fsck.h
parentd40bbc109b6f5d9e5e5088095cc33fef2e25971e (diff)
downloadgit-733902905d4db54612fef9755bb31fd35a89e76c.zip
git-733902905d4db54612fef9755bb31fd35a89e76c.tar.gz
git-733902905d4db54612fef9755bb31fd35a89e76c.tar.bz2
fsck: use oids rather than objects for object_name API
We don't actually care about having object structs; we only need to look up decorations by oid. Let's accept this more limited form, which will give our callers more flexibility. Note that the decoration API we rely on uses object structs itself (even though it only looks at their oids). We can solve this by switching to a kh_oid_map (we could also use the hashmap oidmap, but it's more awkward for the simple case of just storing a void pointer). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.h')
-rw-r--r--fsck.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/fsck.h b/fsck.h
index 6228f0b..36cfa46 100644
--- a/fsck.h
+++ b/fsck.h
@@ -38,7 +38,7 @@ struct fsck_options {
unsigned strict:1;
int *msg_type;
struct oidset skiplist;
- struct decoration *object_names;
+ kh_oid_map_t *object_names;
};
#define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL, OIDSET_INIT }
@@ -84,11 +84,12 @@ int fsck_finish(struct fsck_options *options);
*/
void fsck_enable_object_names(struct fsck_options *options);
const char *fsck_get_object_name(struct fsck_options *options,
- struct object *obj);
+ const struct object_id *oid);
__attribute__((format (printf,3,4)))
-void fsck_put_object_name(struct fsck_options *options, struct object *obj,
+void fsck_put_object_name(struct fsck_options *options,
+ const struct object_id *oid,
const char *fmt, ...);
const char *fsck_describe_object(struct fsck_options *options,
- struct object *obj);
+ const struct object_id *oid);
#endif