From 08a8757fa54ee70d31882344ca7f19de5cbe4690 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 20 May 2008 22:32:22 +0200 Subject: ui-tree.c: avoid peeking at GITLINK objects When an object in the tree has GITLINK mode-bits we don't need to get any more info about that particular object (and trying to get more info about it will usually generate an annoying warning on stderr since the object typically doesn't exist in the repo anyways). Signed-off-by: Lars Hjemli --- ui-tree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 2f052c7..5a2dd3f 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -73,12 +73,14 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, fullpath = fmt("%s%s%s", ctx.qry.path ? ctx.qry.path : "", ctx.qry.path ? "/" : "", name); - type = sha1_object_info(sha1, &size); - if (type == OBJ_BAD && !S_ISGITLINK(mode)) { - htmlf("Bad object: %s %s", - name, - sha1_to_hex(sha1)); - return 0; + if (!S_ISGITLINK(mode)) { + type = sha1_object_info(sha1, &size); + if (type == OBJ_BAD) { + htmlf("Bad object: %s %s", + name, + sha1_to_hex(sha1)); + return 0; + } } html(""); -- cgit v1.2.3-70-g09d2