summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:09 (GMT)
commita2cec42213c55dd3ff9febb51612e3f1cab37b12 (patch)
tree1eb46a50269638c2163b156fd5b475ac6d95d750 /refs.c
parent67b878eba14de15bac927bdfa39c2b71ab68fa70 (diff)
parent2dc417ab1fa87cbab99eaf8a293380fa763dcd2b (diff)
downloadgit-a2cec42213c55dd3ff9febb51612e3f1cab37b12.zip
git-a2cec42213c55dd3ff9febb51612e3f1cab37b12.tar.gz
git-a2cec42213c55dd3ff9febb51612e3f1cab37b12.tar.bz2
Merge branch 'sb/object-store-replace'
Hotfix. * sb/object-store-replace: get_main_ref_store: BUG() when outside a repository object.c: clear replace map before freeing it replace-object.c: remove the_repository from prepare_replace_object object.c: free replace map in raw_object_store_clear
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 64aadd1..2e4a42f 100644
--- a/refs.c
+++ b/refs.c
@@ -1668,6 +1668,9 @@ struct ref_store *get_main_ref_store(struct repository *r)
if (r->refs)
return r->refs;
+ if (!r->gitdir)
+ BUG("attempting to get main_ref_store outside of repository");
+
r->refs = ref_store_init(r->gitdir, REF_STORE_ALL_CAPS);
return r->refs;
}