diff options
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/ui-shared.c b/ui-shared.c index 31224bc..77a302d 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -712,45 +712,6 @@ static int print_branch_option(const char *refname, const unsigned char *sha1, | |||
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
715 | static int print_archive_ref(const char *refname, const unsigned char *sha1, | ||
716 | int flags, void *cb_data) | ||
717 | { | ||
718 | struct tag *tag; | ||
719 | struct taginfo *info; | ||
720 | struct object *obj; | ||
721 | char buf[256], *url; | ||
722 | unsigned char fileid[20]; | ||
723 | int *header = (int *)cb_data; | ||
724 | |||
725 | if (prefixcmp(refname, "refs/archives")) | ||
726 | return 0; | ||
727 | strncpy(buf, refname + 14, sizeof(buf)); | ||
728 | obj = parse_object(sha1); | ||
729 | if (!obj) | ||
730 | return 1; | ||
731 | if (obj->type == OBJ_TAG) { | ||
732 | tag = lookup_tag(sha1); | ||
733 | if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) | ||
734 | return 0; | ||
735 | hashcpy(fileid, tag->tagged->sha1); | ||
736 | } else if (obj->type != OBJ_BLOB) { | ||
737 | return 0; | ||
738 | } else { | ||
739 | hashcpy(fileid, sha1); | ||
740 | } | ||
741 | if (!*header) { | ||
742 | html("<h1>download</h1>\n"); | ||
743 | *header = 1; | ||
744 | } | ||
745 | url = cgit_pageurl(ctx.qry.repo, "blob", | ||
746 | fmt("id=%s&path=%s", sha1_to_hex(fileid), | ||
747 | buf)); | ||
748 | html_link_open(url, NULL, "menu"); | ||
749 | html_txt(strlpart(buf, 20)); | ||
750 | html_link_close(); | ||
751 | return 0; | ||
752 | } | ||
753 | |||
754 | void cgit_add_hidden_formfields(int incl_head, int incl_search, | 715 | void cgit_add_hidden_formfields(int incl_head, int incl_search, |
755 | const char *page) | 716 | const char *page) |
756 | { | 717 | { |