checkout.h: wrap the arguments to unique_tracking_name()
[gitweb.git] / repository.c
index beff3caa9e24a902e560372cdab3c337769c7c89..02fe884603df56ea0996121152b7640afb56a48f 100644 (file)
@@ -238,7 +238,8 @@ void repo_clear(struct repository *repo)
 
        if (repo->index) {
                discard_index(repo->index);
-               FREE_AND_NULL(repo->index);
+               if (repo->index != &the_index)
+                       FREE_AND_NULL(repo->index);
        }
 }