| @@ -89,6 +89,7 @@ static void print_object(const struct object_id *oid, const char *path, const ch · 88 unmodified lines |
| 89 | 89 | enum object_type type; |
| 90 | 90 | char *buf; |
| 91 | 91 | unsigned long size; |
| 92 | + bool is_binary; |
| 92 | 93 | |
| 93 | 94 | type = oid_object_info(the_repository, oid, &size); |
| 94 | 95 | if (type == OBJ_BAD) { |
| @@ -103,6 +104,7 @@ static void print_object(const struct object_id *oid, const char *path, const ch · 8 unmodified lines |
| 103 | 104 | "Error reading object %s", oid_to_hex(oid)); |
| 104 | 105 | return; |
| 105 | 106 | } |
| 107 | + is_binary = buffer_is_binary(buf, size); |
| 106 | 108 | |
| 107 | 109 | cgit_set_title_from_path(path); |
| 108 | 110 | |
| @@ -110,7 +112,7 @@ static void print_object(const struct object_id *oid, const char *path, const ch · 1 unmodified line |
| 110 | 112 | htmlf("blob: %s (", oid_to_hex(oid)); |
| 111 | 113 | cgit_plain_link("plain", NULL, NULL, ctx.qry.head, |
| 112 | 114 | rev, path); |
| 113 | | − if (ctx.repo->enable_blame) { |
| 115 | + if (ctx.repo->enable_blame && !is_binary) { |
| 114 | 116 | html(") ("); |
| 115 | 117 | cgit_blame_link("blame", NULL, NULL, ctx.qry.head, |
| 116 | 118 | rev, path); |
| @@ -123,7 +125,7 @@ static void print_object(const struct object_id *oid, const char *path, const ch · 6 unmodified lines |
| 123 | 125 | return; |
| 124 | 126 | } |
| 125 | 127 | |
| 126 | | − if (buffer_is_binary(buf, size)) |
| 128 | + if (is_binary) |
| 127 | 129 | print_binary_buffer(buf, size); |
| 128 | 130 | else |
| 129 | 131 | print_text_buffer(basename, buf, size); |