Code

[PATCH] Un unoptimize ls-tree behaviour
authorJunio C Hamano <junkio@cox.net>
Sat, 16 Apr 2005 20:57:39 +0000 (13:57 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 20:57:39 +0000 (13:57 -0700)
commit0f2303f71957ec68c92487f185435fbec6bd1c79
treee022421aad3c90ef550eaa69b388df25ceb1686b
parenteec8c633c117c83a9fd2be7054b169d3cee5806d
[PATCH] Un unoptimize ls-tree behaviour

ls-tree unconditionally called read_sha1_file() for all paths
even when not needed, which was a mistake introduced by me.
Rectify this by first checking S_ISDIR(mode) and read the tree
contents only when it is a tree and we are recursive.  There is
no need to read it in any other cases.

The patch also removes the confusing comment that led to this
incorrect implementation.

Thanks to Peter Baudis for noticing this problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ls-tree.c