Do not let lstree output recursively when a directory whose name is a prefix of the others is given in the path list.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is how to reproduce the bug:

git init
mkdir prefix && touch prefix/a && git add prefix/a
mkdir prefixdir && touch prefixdir/b && git add prefixdir/b
git commit -a -m "If -r is not given, ls-tree should not show files in subdirs."
git ls-tree --name-only HEAD prefix  # works as expected
git ls-tree --name-only HEAD prefixdir  # works as expected
git ls-tree --name-only HEAD prefix prefixdir  # shows file, not dir

The output of the last command is 

prefix/a
prefixdir

But it should be

prefix
prefixdir

The patch fixes the problem.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]