commit-graph: not compatible with uninitialized repo

Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Aug 20, 2018 at 18:24 UTC 5cef295f283e84351a104c66f949a53a56297aa7
1 file changed +3
commit-graph.c
+3
@@ -62,6 +62,9 @@ extern int read_replace_refs;
62
63 static int commit_graph_compatible(struct repository *r)
64 {
65 + if (!r->gitdir)
66 + return 0;
67 +
68 if (read_replace_refs) {
69 prepare_replace_object(r);
70 if (hashmap_get_size(&r->objects->replace_map->map))