Merge branch 'jc/denoise-rm-to-resolve'
[gitweb.git] / shallow.c
index 02fdbfc554c462c1eecdf1ddc6d17edbc1d8d853..5fa2b15d3705439b0088ac0fa0800c81ffad7a41 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -43,6 +43,13 @@ int register_shallow(struct repository *r, const struct object_id *oid)
 
 int is_repository_shallow(struct repository *r)
 {
+       /*
+        * NEEDSWORK: This function updates
+        * r->parsed_objects->{is_shallow,shallow_stat} as a side effect but
+        * there is no corresponding function to clear them when the shallow
+        * file is updated.
+        */
+
        FILE *fp;
        char buf[1024];
        const char *path = r->parsed_objects->alternate_shallow_file;
@@ -241,7 +248,8 @@ static void check_shallow_file_for_update(struct repository *r)
        if (r->parsed_objects->is_shallow == -1)
                BUG("shallow must be initialized by now");
 
-       if (!stat_validity_check(r->parsed_objects->shallow_stat, git_path_shallow(the_repository)))
+       if (!stat_validity_check(r->parsed_objects->shallow_stat,
+                                git_path_shallow(r)))
                die("shallow file has changed since we read it");
 }