X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/112973615a78ce61fd6e767128df03b075be72ca..97b3d252629a8a3b9d356c2532dec7611438e4b9:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index 553dbaa..caf6a9e 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -15,13 +15,23 @@ char *curr_rev; char *match_path; int header = 0; -static void print_text_buffer(char *buf, unsigned long size) +static void print_text_buffer(const char *name, char *buf, unsigned long size) { unsigned long lineno, idx; const char *numberfmt = "%1$d\n"; html("
|
");
idx = 0;
lineno = 0;
@@ -65,7 +75,7 @@ static void print_binary_buffer(char *buf, unsigned long size)
html("\n");
}
-static void print_object(const unsigned char *sha1, char *path)
+static void print_object(const unsigned char *sha1, char *path, const char *basename)
{
enum object_type type;
char *buf;
@@ -93,7 +103,7 @@ static void print_object(const unsigned char *sha1, char *path)
if (buffer_is_binary(buf, size))
print_binary_buffer(buf, size);
else
- print_text_buffer(buf, size);
+ print_text_buffer(basename, buf, size);
}
@@ -213,7 +223,7 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
ls_head();
return READ_TREE_RECURSIVE;
} else {
- print_object(sha1, buffer);
+ print_object(sha1, buffer, pathname);
return 0;
}
}