]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
Sync with 2.31.5
[thirdparty/git.git] / builtin / grep.c
index 5de725f904419e3db520cc9bedbfd38808b132f2..ab8822e68f42dab702d096f28b88c492e6a3f4ef 100644 (file)
@@ -421,7 +421,7 @@ static int grep_submodule(struct grep_opt *opt,
        struct grep_opt subopt;
        int hit;
 
-       sub = submodule_from_path(superproject, &null_oid, path);
+       sub = submodule_from_path(superproject, null_oid(), path);
 
        if (!is_submodule_active(superproject, path))
                return 0;
@@ -504,6 +504,8 @@ static int grep_cache(struct grep_opt *opt,
        if (repo_read_index(repo) < 0)
                die(_("index file corrupt"));
 
+       /* TODO: audit for interaction with sparse-index. */
+       ensure_full_index(repo->index);
        for (nr = 0; nr < repo->index->cache_nr; nr++) {
                const struct cache_entry *ce = repo->index->cache[nr];