summaryrefslogtreecommitdiff
path: root/ui-view.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui-view.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui-view.c b/ui-view.c
index 85e223c..9d23c45 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -11,7 +11,7 @@
void cgit_print_view(const char *hex)
{
unsigned char sha1[20];
- char type[20];
+ enum object_type type;
unsigned char *buf;
unsigned long size;
@@ -20,20 +20,22 @@ void cgit_print_view(const char *hex)
return;
}
- if (sha1_object_info(sha1, type, &size)){
- cgit_print_error("Bad object name");
+ type = sha1_object_info(sha1, &size);
+ if (type == OBJ_BAD) {
+ cgit_print_error(fmt("Bad object name: %s", hex));
return;
}
- buf = read_sha1_file(sha1, type, &size);
+ buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
- cgit_print_error("Error reading object");
+ cgit_print_error(fmt("Error reading object %s", hex));
return;
}
buf[size] = '\0';
html("<table class='list'>\n");
- htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size);
+ htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n",
+ typename(type), hex, size);
html("<tr><td class='blob'>\n");
html_txt(buf);
html("\n</td></tr>\n");
ternal/feed/cache_v1.go?h=v1.5.2&id=12e4af7b3b73cbcbbd2f0adfea456db540743cf2&follow=1'>Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the las...René 'Necoro' Neumann2-7/+1 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12