diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -275,7 +275,8 @@ static int include_by_branch(const char *cond, size_t cond_len) int flags; int ret; struct strbuf pattern = STRBUF_INIT; - const char *refname = resolve_ref_unsafe("HEAD", 0, NULL, &flags); + const char *refname = !the_repository || !the_repository->gitdir ? + NULL : resolve_ref_unsafe("HEAD", 0, NULL, &flags); const char *shortname; if (!refname || !(flags & REF_ISSYMREF) || |