add a comment about CWD
authorJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 17:31:51 +0000 (13:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 17:37:01 +0000 (13:37 -0400)
commit70d24c03026c8148eee3ae5ae92407214b02cb64
tree6daf93efd753c3a0b6daae73b02a876387f8f458
parent798dfa2d1be4a19568d0432c61b6b050bba87a47
add a comment about CWD

While git ls-files can actually be used on a repo that is not in the
cwd, it works inconsistently. For example, this fails:

git --git-dir=../foo/.git --work-tree=../foo ls-files ../foo

But change some of the paths to absolute and it will succeed. That seems
like a bug in git.

OTOH, this succeeds:

git --git-dir=../foo/.git --work-tree=../foo ls-files

But, that lists paths relative to the top of the --work-tree,
rather than the usual listing them relative to the cwd. Because the cwd
is not in the repo. And so anything parsing the ls-files output of that
is likely to operate on files in the wrong location. Indeed, there is
code in Upgrade/ that has this problem!
CHANGELOG
Git/LsFiles.hs