From 61c3ca978c586c673aec618cb94210657278dda8 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 8 May 2007 22:40:59 +0200 Subject: Update to libgit 1.5.2-rc2 Signed-off-by: Lars Hjemli --- ui-tree.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index b00670e..60f7560 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -14,37 +14,39 @@ static int print_entry(const unsigned char *sha1, const char *base, int stage) { char *name; - char type[20]; + enum object_type type; unsigned long size; - if (sha1_object_info(sha1, type, &size)) { - cgit_print_error(fmt("Bad object name: %s", - sha1_to_hex(sha1))); + name = xstrdup(pathname); + type = sha1_object_info(sha1, &size); + if (type == OBJ_BAD) { + htmlf("Bad object: %s %s", + name, + sha1_to_hex(sha1)); return 0; } - name = xstrdup(pathname); html(""); html_filemode(mode); html(""); - if (S_ISDIR(mode)) { + if (S_ISDIRLNK(mode)) { + htmlf("
%s => submodule
", name); + } else if (S_ISDIR(mode)) { html("", name); } else { html("", name); } - html("'>"); - html_txt(name); - if (S_ISDIR(mode)) - html("/"); - html(""); + html(""); htmlf("%li", size); html("\n"); free(name); -- cgit v1.2.3-59-g8ed1b