tree-walk.c: remove the_repo from get_tree_entry()
[gitweb.git] / match-trees.c
index ddc4d398456363cede9f3f5d4fa602efb402b5bd..de7e8a6783148f8dde8c41a7a80e6930804149aa 100644 (file)
@@ -140,7 +140,7 @@ static void match_trees(const struct object_id *hash1,
        while (one.size) {
                const char *path;
                const struct object_id *elem;
-               unsigned mode;
+               unsigned short mode;
                int score;
 
                elem = tree_entry_extract(&one, &path, &mode);
@@ -196,7 +196,7 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
        rewrite_here = NULL;
        while (desc.size) {
                const char *name;
-               unsigned mode;
+               unsigned short mode;
 
                tree_entry_extract(&desc, &name, &mode);
                if (strlen(name) == toplen &&
@@ -285,12 +285,12 @@ void shift_tree(const struct object_id *hash1,
 
        if (add_score < del_score) {
                /* We need to pick a subtree of two */
-               unsigned mode;
+               unsigned short mode;
 
                if (!*del_prefix)
                        return;
 
-               if (get_tree_entry(hash2, del_prefix, shifted, &mode))
+               if (get_tree_entry(the_repository, hash2, del_prefix, shifted, &mode))
                        die("cannot find path %s in tree %s",
                            del_prefix, oid_to_hex(hash2));
                return;
@@ -313,16 +313,16 @@ void shift_tree_by(const struct object_id *hash1,
                   const char *shift_prefix)
 {
        struct object_id sub1, sub2;
-       unsigned mode1, mode2;
+       unsigned short mode1, mode2;
        unsigned candidate = 0;
 
        /* Can hash2 be a tree at shift_prefix in tree hash1? */
-       if (!get_tree_entry(hash1, shift_prefix, &sub1, &mode1) &&
+       if (!get_tree_entry(the_repository, 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, shift_prefix, &sub2, &mode2) &&
+       if (!get_tree_entry(the_repository, hash2, shift_prefix, &sub2, &mode2) &&
            S_ISDIR(mode2))
                candidate |= 2;