path: root/t
diff options
authorJunio C Hamano <>2005-05-28 07:05:38 (GMT)
committerLinus Torvalds <>2005-05-29 18:40:40 (GMT)
commit6af1f0192ff8740fe77db7cf02c739ccfbdf119c (patch)
tree944858d4fb8a907b52ea340eefd6b66d5f156393 /t
parent2bc2564145835996734d6ed5d1880f85b17233d6 (diff)
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
This is a complete rewrite of ls-tree to make it behave more like what "/bin/ls -a" does in the current working directory. Namely, the changes are: - Unlike the old ls-tree behaviour that used paths arguments to restrict output (not that it worked as intended---as pointed out in the mailing list discussion, it was quite incoherent), this rewrite uses paths arguments to specify what to show. - Without arguments, it implicitly uses the root level as its sole argument ("/bin/ls -a" behaves as if "." is given without argument). - Without -r (recursive) flag, it shows the named blob (either file or symlink), or the named tree and its immediate children. - With -r flag, it shows the named path, and recursively descends into it if it is a tree. - With -d flag, it shows the named path and does not show its children even if the path is a tree, nor descends into it recursively. This is still request-for-comments patch. There is no mailing list consensus that this proposed new behaviour is a good one. The patch to t/ illustrates user-visible behaviour changes. Namely: * "git-ls-tree $tree path1 path0" lists path1 first and then path0. It used to use paths as an output restrictor and showed output in cache entry order (i.e. path0 first and then path1) regardless of the order of paths arguments. * "git-ls-tree $tree path2" lists path2 and its immediate children but having explicit paths argument does not imply recursive behaviour anymore, hence paths/baz is shown but not paths/baz/b. Signed-off-by: Junio C Hamano <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 't')
1 files changed, 1 insertions, 2 deletions
diff --git a/t/ b/t/
index 70fa9ac..02d93eb 100644
--- a/t/
+++ b/t/
@@ -74,8 +74,8 @@ test_expect_success \
'ls-tree filtered' \
'git-ls-tree $tree path1 path0 >current &&
cat >expected <<\EOF &&
-100644 blob X path0
120000 blob X path1
+100644 blob X path0
@@ -85,7 +85,6 @@ test_expect_success \
cat >expected <<\EOF &&
040000 tree X path2
040000 tree X path2/baz
-100644 blob X path2/baz/b
120000 blob X path2/bazbo
100644 blob X path2/foo