Website Summary Files Commits Branches @commit @diff @stats
path: root / cgit.c
diff options
context:
space:
mode:
1 files changed, 1 insertions, 1 deletions
-rw-r--r--cgit.c2
diff --git a/cgit.c b/cgit.c
index 2efbb2c..6ee5530 100644
--- a/cgit.c
+++ b/cgit.c
@@ -496,7 +496,7 @@ static char *guess_defbranch(void)
ref = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
"HEAD", 0, &oid, NULL);
- if (!ref || !skip_prefix(ref, "ref: refs/heads/", &refname))
+ if (!ref || (!skip_prefix(ref, "ref: refs/heads/", &refname) && !skip_prefix(ref, "refs/heads/", &refname)))
return "master";
return xstrdup(refname);
}