diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-05-09 00:40:59 +0400 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-09 01:38:49 +0400 |
commit | 61c3ca978c586c673aec618cb94210657278dda8 (patch) | |
tree | 7011987769e65ad0e7aa8b79f648357e9cd88c30 /ui-view.c | |
parent | 66cacd053ba900c8eb3b7962027370c84a97f990 (diff) |
Update to libgit 1.5.2-rc2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-view.c')
-rw-r--r-- | ui-view.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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"); |