author | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Apr 2005 20:57:39 +0000 (13:57 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 16 Apr 2005 20:57:39 +0000 (13:57 -0700) | ||
commit | 0f2303f71957ec68c92487f185435fbec6bd1c79 | |
tree | e022421aad3c90ef550eaa69b388df25ceb1686b | tree | snapshot |
parent | eec8c633c117c83a9fd2be7054b169d3cee5806d | commit | diff |
[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 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 | diff | blob | history |