Skip to content

Commit f26efc5

Browse files
bk2204gitster
authored andcommitted
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>
1 parent 3aca1fc commit f26efc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
5858
{
5959
struct tree_desc desc;
6060
struct name_entry entry;
61-
unsigned char sha1[20];
61+
struct object_id oid;
6262
int len, oldlen = base->len;
6363
enum interesting retval = entry_not_interesting;
6464

@@ -87,7 +87,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
8787
}
8888

8989
if (S_ISDIR(entry.mode))
90-
hashcpy(sha1, entry.oid->hash);
90+
oidcpy(&oid, entry.oid);
9191
else if (S_ISGITLINK(entry.mode)) {
9292
struct commit *commit;
9393

@@ -102,15 +102,15 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
102102
oid_to_hex(entry.oid),
103103
base->buf, entry.path);
104104

105-
hashcpy(sha1, commit->tree->object.oid.hash);
105+
oidcpy(&oid, &commit->tree->object.oid);
106106
}
107107
else
108108
continue;
109109

110110
len = tree_entry_len(&entry);
111111
strbuf_add(base, entry.path, len);
112112
strbuf_addch(base, '/');
113-
retval = read_tree_1(lookup_tree(sha1),
113+
retval = read_tree_1(lookup_tree(oid.hash),
114114
base, stage, pathspec,
115115
fn, context);
116116
strbuf_setlen(base, oldlen);

0 commit comments

Comments
 (0)