diff options
Diffstat (limited to 'match-trees.c')
-rw-r--r-- | match-trees.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/match-trees.c b/match-trees.c index 0ca99d5162..72cc2baa3f 100644 --- a/match-trees.c +++ b/match-trees.c @@ -54,7 +54,7 @@ static void *fill_tree_desc_strict(struct tree_desc *desc, enum object_type type; unsigned long size; - buffer = read_sha1_file(hash->hash, &type, &size); + buffer = read_object_file(hash, &type, &size); if (!buffer) die("unable to read tree (%s)", oid_to_hex(hash)); if (type != OBJ_TREE) @@ -180,7 +180,7 @@ static int splice_tree(const struct object_id *oid1, const char *prefix, if (*subpath) subpath++; - buf = read_sha1_file(oid1->hash, &type, &sz); + buf = read_object_file(oid1, &type, &sz); if (!buf) die("cannot read tree %s", oid_to_hex(oid1)); init_tree_desc(&desc, buf, sz); @@ -269,7 +269,7 @@ void shift_tree(const struct object_id *hash1, if (!*del_prefix) return; - if (get_tree_entry(hash2->hash, del_prefix, shifted->hash, &mode)) + if (get_tree_entry(hash2, del_prefix, shifted, &mode)) die("cannot find path %s in tree %s", del_prefix, oid_to_hex(hash2)); return; @@ -296,12 +296,12 @@ void shift_tree_by(const struct object_id *hash1, unsigned candidate = 0; /* Can hash2 be a tree at shift_prefix in tree hash1? */ - if (!get_tree_entry(hash1->hash, shift_prefix, sub1.hash, &mode1) && + if (!get_tree_entry(hash1, shift_prefix, &sub1, &mode1) && S_ISDIR(mode1)) candidate |= 1; /* Can hash1 be a tree at shift_prefix in tree hash2? */ - if (!get_tree_entry(hash2->hash, shift_prefix, sub2.hash, &mode2) && + if (!get_tree_entry(hash2, shift_prefix, &sub2, &mode2) && S_ISDIR(mode2)) candidate |= 2; |