diff options
Diffstat (limited to 'src/gistatic.c')
-rw-r--r-- | src/gistatic.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gistatic.c b/src/gistatic.c index 2ab7865..f049b74 100644 --- a/src/gistatic.c +++ b/src/gistatic.c @@ -871,8 +871,8 @@ static int index_write_header(FILE *const fd, const char *const idx_title) { } static char *footer_signature_string() { - const size_t signature_size = strlen(_(MSG_FOOTER_TEMPLATE)) - strlen("%s") - + strlen(PROJECT_HOMEPAGE_LINK) + sizeof('\0'); + const size_t signature_size = strlen(_(MSG_FOOTER_TEMPLATE)) + - strlen("%s") + strlen(PROJECT_HOMEPAGE_LINK) + sizeof('\0'); char *const signature_text = malloc(signature_size); if (!signature_text) { logerrl("malloc(", signature_size, ")", strerror(errno), @@ -1626,19 +1626,25 @@ static int repo_write_snapshots( struct git_reference *ref; while (!(e = git_reference_next(&ref, ref_iter))) { - if ( - !git_reference_is_tag(ref) - && !git_reference_is_branch(ref) - && !git_reference_is_note(ref) - ) { - git_reference_free(ref); - continue; + const char *const name = git_reference_shorthand(ref); + assert(name); + const bool is_tag = git_reference_is_tag(ref); + const bool is_branch = git_reference_is_branch(ref); + const bool is_note = git_reference_is_note(ref); + + if (!is_tag && !is_branch && !is_note) { + goto loop_cleanup; + } + if (is_note && strcmp(name, "notes/signatures/tar.xz") != 0) { + goto loop_cleanup; } + printf("reference name: %s\n", git_reference_shorthand(ref)); + // https://github.com/ionescu007/minlzma // https://git.tukaani.org/?p=xz.git;a=tree;f=src;h=665b39e6439f1bb5afd9181ec0890c2ed26d047e;hb=HEAD // git archive --format tar.xz --prefix "$PROJECT-$tag/" "$tag" - // printf("reference name: %s\n", git_reference_shorthand(ref)); + loop_cleanup: git_reference_free(ref); } if (e != GIT_ITEROVER) { |