]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
gitweb: correctly store previous rev in javascript-actions mode
[thirdparty/git.git] / config.c
index ed7f58e0fcf221733165f3dd6a9d095d727a0a5e..3900e4947be92b916ed9b531eb455e8f856105dc 100644 (file)
--- a/config.c
+++ b/config.c
@@ -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) ||