revision.c: reduce implicit dependency the_repository
[gitweb.git] / builtin / add.c
index ba1ff5689d07d1e40bcdd03a13e7c58752b28587..f94b614c1c333a8fc35161cb2cb27b9e7384a4fc 100644 (file)
@@ -40,7 +40,7 @@ static void chmod_pathspec(struct pathspec *pathspec, char flip)
        for (i = 0; i < active_nr; i++) {
                struct cache_entry *ce = active_cache[i];
 
-               if (pathspec && !ce_path_match(ce, pathspec, NULL))
+               if (pathspec && !ce_path_match(&the_index, ce, pathspec, NULL))
                        continue;
 
                if (chmod_cache_entry(ce, flip) < 0)
@@ -110,7 +110,7 @@ int add_files_to_cache(const char *prefix,
        memset(&data, 0, sizeof(data));
        data.flags = flags;
 
-       init_revisions(&rev, prefix);
+       repo_init_revisions(the_repository, &rev, prefix);
        setup_revisions(0, NULL, &rev, NULL);
        if (pathspec)
                copy_pathspec(&rev.prune_data, pathspec);
@@ -135,7 +135,7 @@ static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
                        continue; /* do not touch unmerged paths */
                if (!S_ISREG(ce->ce_mode) && !S_ISLNK(ce->ce_mode))
                        continue; /* do not touch non blobs */
-               if (pathspec && !ce_path_match(ce, pathspec, NULL))
+               if (pathspec && !ce_path_match(&the_index, ce, pathspec, NULL))
                        continue;
                retval |= add_file_to_cache(ce->name, flags | HASH_RENORMALIZE);
        }
@@ -155,7 +155,7 @@ static char *prune_directory(struct dir_struct *dir, struct pathspec *pathspec,
        i = dir->nr;
        while (--i >= 0) {
                struct dir_entry *entry = *src++;
-               if (dir_path_match(entry, pathspec, prefix, seen))
+               if (dir_path_match(&the_index, entry, pathspec, prefix, seen))
                        *dst++ = entry;
        }
        dir->nr = dst - dir->entries;
@@ -232,7 +232,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
        if (read_cache() < 0)
                die(_("Could not read the index"));
 
-       init_revisions(&rev, prefix);
+       repo_init_revisions(the_repository, &rev, prefix);
        rev.diffopt.context = 7;
 
        argc = setup_revisions(argc, argv, &rev, NULL);