Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tree: convert read_tree_1 to use struct object_id internally
author
brian m. carlson
<sandals@crustytoothpaste.net>
Sat, 6 May 2017 22:10:15 +0000
(22:10 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 8 May 2017 06:12:57 +0000
(15:12 +0900)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
3aca1fc
)
diff --git
a/tree.c
b/tree.c
index 33fa7ee7176474d4a3c218a76a7b238a86f720d6..21fd80b801aec559cdc88d8b9e7fc88054b8a6be 100644
(file)
--- a/
tree.c
+++ b/
tree.c
@@
-58,7
+58,7
@@
static int read_tree_1(struct tree *tree, struct strbuf *base,
{
struct tree_desc desc;
struct name_entry entry;
{
struct tree_desc desc;
struct name_entry entry;
-
unsigned char sha1[20]
;
+
struct object_id oid
;
int len, oldlen = base->len;
enum interesting retval = entry_not_interesting;
int len, oldlen = base->len;
enum interesting retval = entry_not_interesting;
@@
-87,7
+87,7
@@
static int read_tree_1(struct tree *tree, struct strbuf *base,
}
if (S_ISDIR(entry.mode))
}
if (S_ISDIR(entry.mode))
-
hashcpy(sha1, entry.oid->hash
);
+
oidcpy(&oid, entry.oid
);
else if (S_ISGITLINK(entry.mode)) {
struct commit *commit;
else if (S_ISGITLINK(entry.mode)) {
struct commit *commit;
@@
-102,7
+102,7
@@
static int read_tree_1(struct tree *tree, struct strbuf *base,
oid_to_hex(entry.oid),
base->buf, entry.path);
oid_to_hex(entry.oid),
base->buf, entry.path);
-
hashcpy(sha1, commit->tree->object.oid.hash
);
+
oidcpy(&oid, &commit->tree->object.oid
);
}
else
continue;
}
else
continue;
@@
-110,7
+110,7
@@
static int read_tree_1(struct tree *tree, struct strbuf *base,
len = tree_entry_len(&entry);
strbuf_add(base, entry.path, len);
strbuf_addch(base, '/');
len = tree_entry_len(&entry);
strbuf_add(base, entry.path, len);
strbuf_addch(base, '/');
- retval = read_tree_1(lookup_tree(
sha1
),
+ retval = read_tree_1(lookup_tree(
oid.hash
),
base, stage, pathspec,
fn, context);
strbuf_setlen(base, oldlen);
base, stage, pathspec,
fn, context);
strbuf_setlen(base, oldlen);