Say I have a repo with these files:
aaa.txt
f1/bbb.txt
f1/f2/ccc.txt
If my CWD is the top of working tree, I get this result:
$ git ls-tree -r --name-only $(git write-tree)
aaa.txt
f1/bbb.txt
f1/f2/ccc.txt
$ git ls-tree -rd --name-only $(git write-tree)
f1
f1/f2
If my CWD is in the f1
directory, I get this result:
$ git ls-tree -r --name-only $(git write-tree)
bbb.txt
f2/ccc.txt
$ git ls-tree -rd --name-only $(git write-tree)
I expect git ls-tree -rd --name-only $(git write-tree)
to return f2
. However the result is empty. Am I doing something wrong?