repo->desc = xstrdup(value);
else if (!strcmp(name, "owner"))
repo->owner = xstrdup(value);
repo->desc = xstrdup(value);
else if (!strcmp(name, "owner"))
repo->owner = xstrdup(value);
else if (!strcmp(name, "defbranch"))
repo->defbranch = xstrdup(value);
else if (!strcmp(name, "snapshots"))
else if (!strcmp(name, "defbranch"))
repo->defbranch = xstrdup(value);
else if (!strcmp(name, "snapshots"))
- ref = resolve_ref_unsafe("HEAD", 0, sha1, NULL);
+ ref = resolve_ref_unsafe("HEAD", 0, oid.hash, NULL);
if (!ref || !starts_with(ref, "refs/heads/"))
return "master";
return xstrdup(ref + 11);
}
if (!ref || !starts_with(ref, "refs/heads/"))
return "master";
return xstrdup(ref + 11);
}
/* The caller must free filename and ref after calling this. */
static inline void parse_readme(const char *readme, char **filename, char **ref, struct cgit_repo *repo)
{
/* The caller must free filename and ref after calling this. */
static inline void parse_readme(const char *readme, char **filename, char **ref, struct cgit_repo *repo)
{
- if (get_sha1(ctx.qry.head, sha1)) {
- char *tmp = xstrdup(ctx.qry.head);
- ctx.qry.head = ctx.repo->defbranch;
+ if (get_oid(ctx.qry.head, &oid)) {
+ char *old_head = ctx.qry.head;
+ ctx.qry.head = xstrdup(ctx.repo->defbranch);
fprintf(f, "repo.module-link=%s\n", repo->module_link);
if (repo->section)
fprintf(f, "repo.section=%s\n", repo->section);
fprintf(f, "repo.module-link=%s\n", repo->module_link);
if (repo->section)
fprintf(f, "repo.section=%s\n", repo->section);
if (repo->clone_url)
fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
fprintf(f, "repo.enable-commit-graph=%d\n",
if (repo->clone_url)
fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
fprintf(f, "repo.enable-commit-graph=%d\n",
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--version")) {
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--version")) {