commit-graph: not compatible with uninitialized repo

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Derrick Stolee 2018-08-20 18:24:32 +00:00 committed by Junio C Hamano
parent 20fd6d5799
commit 5cef295f28
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ extern int read_replace_refs;

static int commit_graph_compatible(struct repository *r)
{
if (!r->gitdir)
return 0;

if (read_replace_refs) {
prepare_replace_object(r);
if (hashmap_get_size(&r->objects->replace_map->map))