Merge branch 'jc/missing-ref-store-fix'

We've left the command line parsing of "git log :/a/b/" broken for
about a full year without anybody noticing, which has been
corrected.

* jc/missing-ref-store-fix:
  repository: mark the "refs" pointer as private
  sha1-name: do not assume that the ref store is initialized
This commit is contained in:
Junio C Hamano
2020-04-22 13:42:55 -07:00
4 changed files with 16 additions and 8 deletions

8
refs.c
View File

@ -1852,14 +1852,14 @@ static struct ref_store *ref_store_init(const char *gitdir,
struct ref_store *get_main_ref_store(struct repository *r)
{
if (r->refs)
return r->refs;
if (r->refs_private)
return r->refs_private;
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;
r->refs_private = ref_store_init(r->gitdir, REF_STORE_ALL_CAPS);
return r->refs_private;
}
/*