Git ls-tree -rd runs bizzare in a subdirectory

Let's say I have a repo with these files:

aaa.txt
f1/bbb.txt
f1/f2/ccc.txt

      

If my CWD is the top of the 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 a directory f1

, 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 to git ls-tree -rd --name-only $(git write-tree)

come back f2

. However, the result is empty. Am I doing something wrong?

+3


source to share


1 answer


It might be an issue related to the old msysgit 32bits Git For Windows 1.9.5 , where I reproduced the same issue.

I just tested it in a Git bash session using the new msys2 64bits Git For Windows 2.3.5 and it works great.



VonC@voncvb MINGW64 /c/Users/VonC/prog/go/src/github.com/VonC/senvgo (master)
$ git ls-tree -rd --name-only $(git write-tree)
.deps
.deps/godbg
configs
envs
installer
paths
paths/7z
prgs

VonC@voncvb MINGW64 /c/Users/VonC/prog/go/src/github.com/VonC/senvgo (master)
$ cd paths/

VonC@voncvb MINGW64 /c/Users/VonC/prog/go/src/github.com/VonC/senvgo/paths (master)
$ git ls-tree -rd --name-only $(git write-tree)
./
7z

      

0


source







All Articles