unpack-trees: don't shadow global var the_index
[gitweb.git] / archive.c
index 875dab64b606704d2510b05889a934ed885019ee..c81e35bf2359e898a1f47b48346dfd2ebbfe6dbe 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -79,7 +79,7 @@ void *object_file_to_archive(const struct archiver_args *args,
                size_t size = 0;
 
                strbuf_attach(&buf, buffer, *sizep, *sizep + 1);
-               convert_to_working_tree(path, buf.buf, buf.len, &buf);
+               convert_to_working_tree(&the_index, path, buf.buf, buf.len, &buf);
                if (commit)
                        format_subst(commit, buf.buf, buf.len, &buf);
                buffer = strbuf_detach(&buf, &size);
@@ -109,7 +109,7 @@ static const struct attr_check *get_archive_attrs(const char *path)
        static struct attr_check *check;
        if (!check)
                check = attr_check_initl("export-ignore", "export-subst", NULL);
-       return git_check_attr(path, check) ? NULL : check;
+       return git_check_attr(&the_index, path, check) ? NULL : check;
 }
 
 static int check_attr_export_ignore(const struct attr_check *check)
@@ -313,7 +313,7 @@ static int reject_entry(const struct object_id *oid, struct strbuf *base,
                struct strbuf sb = STRBUF_INIT;
                strbuf_addbuf(&sb, base);
                strbuf_addstr(&sb, filename);
-               if (!match_pathspec(context, sb.buf, sb.len, 0, NULL, 1))
+               if (!match_pathspec(&the_index, context, sb.buf, sb.len, 0, NULL, 1))
                        ret = READ_TREE_RECURSIVE;
                strbuf_release(&sb);
        }
@@ -380,7 +380,7 @@ static void parse_treeish_arg(const char **argv,
        if (get_oid(name, &oid))
                die("Not a valid object name");
 
-       commit = lookup_commit_reference_gently(&oid, 1);
+       commit = lookup_commit_reference_gently(the_repository, &oid, 1);
        if (commit) {
                commit_sha1 = commit->object.oid.hash;
                archive_time = commit->date;