summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-05-25 18:38:57 +0000
committerJunio C Hamano <gitster@pobox.com>2015-05-25 12:19:33 -0700
commitf124b7302353fb38f39bf4b44fd8bb0fc950c7d1 (patch)
tree12723c84d5d501a25216bbc81b429776c6f410ee /log-tree.c
parent5f9cf5abd2f918d374d11a0f468bc2387a3d32c2 (diff)
downloadgit-f124b7302353fb38f39bf4b44fd8bb0fc950c7d1.tar.gz
add_ref_decoration(): rewrite to take an object_id argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/log-tree.c b/log-tree.c
index 1a0e170793..abf5cc31e5 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -89,7 +89,8 @@ const struct name_decoration *get_name_decoration(const struct object *obj)
return lookup_decoration(&name_decoration, obj);
}
-static int add_ref_decoration(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
+static int add_ref_decoration(const char *refname, const struct object_id *oid,
+ int flags, void *cb_data)
{
struct object *obj;
enum decoration_type type = DECORATION_NONE;
@@ -110,7 +111,7 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
return 0;
}
- obj = parse_object(sha1);
+ obj = parse_object(oid->hash);
if (!obj)
return 0;
@@ -149,13 +150,11 @@ static int add_graft_decoration(const struct commit_graft *graft, void *cb_data)
void load_ref_decorations(int flags)
{
if (!decoration_loaded) {
- struct each_ref_fn_sha1_adapter wrapped_add_ref_decoration =
- {add_ref_decoration, NULL};
decoration_loaded = 1;
decoration_flags = flags;
- for_each_ref(each_ref_fn_adapter, &wrapped_add_ref_decoration);
- head_ref(each_ref_fn_adapter, &wrapped_add_ref_decoration);
+ for_each_ref(add_ref_decoration, NULL);
+ head_ref(add_ref_decoration, NULL);
for_each_commit_graft(add_graft_decoration, NULL);
}
}