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>
brian m. carlson committed
May 6, 2017 at 22:10 UTC
49a09e74a413cfccee2c249407b46cdd0ea699cd
1 file changed
+5
-5
builtin/reflog.c
+5
-5
@@ -55,14 +55,14 @@ struct collect_reflog_cb {
55
#define STUDYING (1u<<11)
56
#define REACHABLE (1u<<12)
57
58
-static int tree_is_complete(const unsigned char *sha1)
58
+static int tree_is_complete(const struct object_id *oid)
59
{
60
struct tree_desc desc;
61
struct name_entry entry;
62
int complete;
63
struct tree *tree;
64
65
- tree = lookup_tree(sha1);
65
+ tree = lookup_tree(oid->hash);
66
if (!tree)
67
return 0;
68
if (tree->object.flags & SEEN)
@@ -73,7 +73,7 @@ static int tree_is_complete(const unsigned char *sha1)
73
if (!tree->buffer) {
74
enum object_type type;
75
unsigned long size;
76
- void *data = read_sha1_file(sha1, &type, &size);
76
+ void *data = read_sha1_file(oid->hash, &type, &size);
77
if (!data) {
78
tree->object.flags |= INCOMPLETE;
79
return 0;
@@ -85,7 +85,7 @@ static int tree_is_complete(const unsigned char *sha1)
85
complete = 1;
86
while (tree_entry(&desc, &entry)) {
87
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))) {
89
tree->object.flags |= INCOMPLETE;
90
complete = 0;
91
}
@@ -152,7 +152,7 @@ static int commit_is_complete(struct commit *commit)
152
for (i = 0; i < found.nr; i++) {
153
struct commit *c =
154
(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)) {
156
is_incomplete = 1;
157
c->object.flags |= INCOMPLETE;
158
}