My pretty neat website
git clone git://soophie.de/soso
diff --git a/src/module/git_repo.c b/src/module/git_repo.c
index e728bd8..0608477 100644
--- a/src/module/git_repo.c
+++ b/src/module/git_repo.c
1
@@ -175,6 +175,24 @@ static orb_rc_t fetch(orb_module_t *self) {2
git_reference_free(ref_handle);3
}4
git_reference_iterator_free(iter);5
+ if (!data->repo.ref) {6
+ git_object *obj_handle = NULL;7
+ if (git_object_lookup(&obj_handle, data->repo.handle, &ref_oid, GIT_OBJECT_COMMIT) == 0) {8
+ git_object_free(obj_handle);9
+ data->repo.ref_list = realloc(data->repo.ref_list, sizeof(git_repo_ref_t) * (data->repo.ref_list_len + 1));10
+ git_repo_ref_t *ref = &data->repo.ref_list[data->repo.ref_list_len];11
+ memset(ref, 0, sizeof(git_repo_ref_t));12
+ ref->oid = strdup(data->repo.flag_ref_oid);13
+ ref->name = strdup(data->repo.flag_ref_oid);14
+ ref->type = "commit";15
+ data->repo.ref_list_len++;16
+ data->repo.ref = calloc(1, sizeof(git_repo_ref_t));17
+ ref = data->repo.ref;18
+ ref->oid = strdup(data->repo.flag_ref_oid);19
+ ref->name = strdup(data->repo.flag_ref_oid);20
+ ref->type = "commit";21
+ }22
+ }23
}24
}25
return ORB_OK;
diff --git a/templ/git_repo_log.html b/templ/git_repo_log.html
index 7fbeafe..6194a29 100644
--- a/templ/git_repo_log.html
+++ b/templ/git_repo_log.html
1
@@ -21,7 +21,7 @@2
git_repo_commit_t *commit = &ctx->commit_list[i];3
%4
<li class="row">5
- <span class="col col--oid" title="% STRING(commit->oid) %">% PRINTF("%%.7s", commit->oid) %</span>6
+ <span class="col col--oid" title="% STRING(commit->oid) %"><a href="?ref=% STRING(commit->oid) %">% PRINTF("%%.7s", commit->oid) %</a></span>7
<span class="col col--time">% FORMAT_TIME(&commit->time, "%%Y-%%m-%%d") %</span>8
<span class="col col--message" title="% STRING(commit->message) %"><a href="/git/% STRING(ctx->repo->meta.name) %/commit?% if (ctx->repo->ref) { %ref=% STRING(ctx->repo->ref->oid) %&% } %oid=% STRING(commit->oid) %">% STRING(commit->summary) %</a></span>9
<span class="col col--author">% STRING(commit->author_name) %</span>