type = sha1_object_info(sha1, &size);
if (type == OBJ_BAD) {
html_status(404, "Not found", 0);
type = sha1_object_info(sha1, &size);
if (type == OBJ_BAD) {
html_status(404, "Not found", 0);
}
buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
html_status(404, "Not found", 0);
}
buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
html_status(404, "Not found", 0);
}
ctx.page.mimetype = NULL;
ext = strrchr(path, '.');
}
ctx.page.mimetype = NULL;
ext = strrchr(path, '.');
cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
fullpath);
html("</li>\n");
cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
fullpath);
html("</li>\n");
- if (S_ISREG(mode))
- print_object(sha1, pathname);
- else if (S_ISDIR(mode)) {
+ if (S_ISREG(mode)) {
+ if (print_object(sha1, pathname))
+ match = 1;
+ } else if (S_ISDIR(mode)) {
print_dir(sha1, base, baselen, pathname);
print_dir(sha1, base, baselen, pathname);
print_dir_entry(sha1, base, baselen, pathname, mode);
print_dir_entry(sha1, base, baselen, pathname, mode);
path_items.match = "";
match_baselen = -1;
print_dir(commit->tree->object.sha1, "", 0, "");
path_items.match = "";
match_baselen = -1;
print_dir(commit->tree->object.sha1, "", 0, "");