Skip to content

Commit 49a09e7

Browse files
bk2204gitster
authored andcommitted
builtin/reflog: convert tree_is_complete to take struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f26efc5 commit 49a09e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/reflog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ struct collect_reflog_cb {
5555
#define STUDYING (1u<<11)
5656
#define REACHABLE (1u<<12)
5757

58-
static int tree_is_complete(const unsigned char *sha1)
58+
static int tree_is_complete(const struct object_id *oid)
5959
{
6060
struct tree_desc desc;
6161
struct name_entry entry;
6262
int complete;
6363
struct tree *tree;
6464

65-
tree = lookup_tree(sha1);
65+
tree = lookup_tree(oid->hash);
6666
if (!tree)
6767
return 0;
6868
if (tree->object.flags & SEEN)
@@ -73,7 +73,7 @@ static int tree_is_complete(const unsigned char *sha1)
7373
if (!tree->buffer) {
7474
enum object_type type;
7575
unsigned long size;
76-
void *data = read_sha1_file(sha1, &type, &size);
76+
void *data = read_sha1_file(oid->hash, &type, &size);
7777
if (!data) {
7878
tree->object.flags |= INCOMPLETE;
7979
return 0;
@@ -85,7 +85,7 @@ static int tree_is_complete(const unsigned char *sha1)
8585
complete = 1;
8686
while (tree_entry(&desc, &entry)) {
8787
if (!has_sha1_file(entry.oid->hash) ||
88-
(S_ISDIR(entry.mode) && !tree_is_complete(entry.oid->hash))) {
88+
(S_ISDIR(entry.mode) && !tree_is_complete(entry.oid))) {
8989
tree->object.flags |= INCOMPLETE;
9090
complete = 0;
9191
}
@@ -152,7 +152,7 @@ static int commit_is_complete(struct commit *commit)
152152
for (i = 0; i < found.nr; i++) {
153153
struct commit *c =
154154
(struct commit *)found.objects[i].item;
155-
if (!tree_is_complete(c->tree->object.oid.hash)) {
155+
if (!tree_is_complete(&c->tree->object.oid)) {
156156
is_incomplete = 1;
157157
c->object.flags |= INCOMPLETE;
158158
}

0 commit comments

Comments
 (0)