tree: convert read_tree_1 to use struct object_id internally
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
May 6, 2017 at 22:10 UTC
f26efc58c881ff71be0c96ffc66eabf5ac75ba84
1 file changed
+4
-4
tree.c
+4
-4
@@ -58,7 +58,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
58
{
59
struct tree_desc desc;
60
struct name_entry entry;
61
- unsigned char sha1[20];
61
+ struct object_id oid;
62
int len, oldlen = base->len;
63
enum interesting retval = entry_not_interesting;
64
@@ -87,7 +87,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
87
}
88
89
if (S_ISDIR(entry.mode))
90
- hashcpy(sha1, entry.oid->hash);
90
+ oidcpy(&oid, entry.oid);
91
else if (S_ISGITLINK(entry.mode)) {
92
struct commit *commit;
93
@@ -102,7 +102,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
102
oid_to_hex(entry.oid),
103
base->buf, entry.path);
104
105
- hashcpy(sha1, commit->tree->object.oid.hash);
105
+ oidcpy(&oid, &commit->tree->object.oid);
106
}
107
else
108
continue;
@@ -110,7 +110,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
110
len = tree_entry_len(&entry);
111
strbuf_add(base, entry.path, len);
112
strbuf_addch(base, '/');
113
- retval = read_tree_1(lookup_tree(sha1),
113
+ retval = read_tree_1(lookup_tree(oid.hash),
114
base, stage, pathspec,
115
fn, context);
116
strbuf_setlen(base, oldlen);