about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-05-20 22:32:22 +0200
committerLars Hjemli <hjemli@gmail.com>2008-05-20 22:32:22 +0200
commit08a8757fa54ee70d31882344ca7f19de5cbe4690 (patch)
tree93cddfcbb81bbaf0fe8b3206d5f2f9c11dc6df9a
parentcache.c: fix error checking in print_slot() (diff)
downloadcgit-pink-08a8757fa54ee70d31882344ca7f19de5cbe4690.tar.gz
cgit-pink-08a8757fa54ee70d31882344ca7f19de5cbe4690.zip
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 <hjemli@gmail.com>
-rw-r--r--ui-tree.c14
1 files changed, 8 insertions, 6 deletions
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("<tr><td colspan='3'>Bad object: %s %s</td></tr>",
-		      name,
-		      sha1_to_hex(sha1));
-		return 0;
+	if (!S_ISGITLINK(mode)) {
+		type = sha1_object_info(sha1, &size);
+		if (type == OBJ_BAD) {
+			htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>",
+			      name,
+			      sha1_to_hex(sha1));
+			return 0;
+		}
 	}
 
 	html("<tr><td class='ls-mode'>");
41e6147e16a614ead51bf7d80896be9f3fdf531c&follow=1'>Add tags targetJune McEnroe 2018-02-06Replace gfxx SCALE macro with interp functionJune McEnroe 2018-02-05Rename gfxx space indexed and add palette samplingJune McEnroe 2018-02-05Take scale into account for when to stop drawing in gfxxJune McEnroe 2018-02-05Always skip most significant bits in gfxxJune McEnroe 2018-02-05Set title in gfcocoaJune McEnroe 2018-02-05Double-buffer gfb frontendJune McEnroe 2018-02-05Rewrite gfxx bit handlingJune McEnroe 2018-02-05Add flip option to gfxxJune McEnroe 2018-02-05Remove gfxx reverse optionJune McEnroe 2018-02-04Fix gfxx draw stop conditionJune McEnroe 2018-02-04Reuse CGColorSpace and CGDataProvider in gfcocoaJune McEnroe 2018-02-04Mark mac target phonyJune McEnroe 2018-02-04Set up Makefile for gfxx-cocoa or gfxx-fbJune McEnroe 2018-02-04Avoid doing excessive work in gfxxJune McEnroe 2018-02-04Handle window resizing in gfcocoaJune McEnroe 2018-02-04Set cinoptionsJune McEnroe 2018-02-04Tweak colorscheme moreJune McEnroe 2018-02-04Color MatchParen DarkYellowJune McEnroe 2018-02-04Add palette sampling to gfxxJune McEnroe 2018-02-04Add 4-bit RGB to gfxxJune McEnroe 2018-02-04Add Quit menu item to gfcocoaJune McEnroe 2018-02-04Switch back to sane Objective-C styleJune McEnroe 2018-02-04Quit gfcocoa when window closesJune McEnroe 2018-02-03Apparently this is how people write Objective-CJune McEnroe