pathspec.c: use the right index instead of the_index
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 9dbe6ffaa7f04ceba22b215a221b9a389d0cad97..fc7d15d549e49113fba73ee98161fafd3fd10a56 100644 (file)
--- a/git.c
+++ b/git.c
@@ -267,7 +267,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                } else if (!strcmp(cmd, "--shallow-file")) {
                        (*argv)++;
                        (*argc)--;
-                       set_alternate_shallow_file((*argv)[0], 1);
+                       set_alternate_shallow_file(the_repository, (*argv)[0], 1);
                        if (envchanged)
                                *envchanged = 1;
                } else if (!strcmp(cmd, "-C")) {
@@ -414,7 +414,10 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
 
        trace_argv_printf(argv, "trace: built-in: git");
 
+       validate_cache_entries(&the_index);
        status = p->fn(argc, argv, prefix);
+       validate_cache_entries(&the_index);
+
        if (status)
                return status;