author | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 07:18:08 +0000 (23:18 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 08:14:42 +0000 (00:14 -0800) | ||
commit | 3296766eb5531ef051ae392114de5d75556f5613 | |
tree | a5a5dd6fd3c83e41fa62e737475573c599da6de4 | tree | snapshot |
parent | b9217642ef2db34e2cbeaef8d4439b07a03027cd | commit | diff |
get_pathspec(): die when an out-of-tree path is given
An earlier commit d089ebaa (setup: sanitize absolute and funny paths) made
get_pathspec() aware of absolute paths, but with a botched interface that
forced the callers to count the resulting pathspecs in order to detect
an error of giving a path that is outside the work tree.
This fixes it, by dying inside the function.
We had ls-tree test that relied on a misfeature in the original
implementation of its pathspec handling. Leading slashes were silently
removed from them. However we allow giving absolute pathnames (people
want to cut and paste from elsewhere) that are inside work tree these
days, so a pathspec that begin with slash _should_ be treated as a full
path. The test is adjusted to match the updated rule for get_pathspec().
Earlier I mistook three tests given by Robin that they should succeed, but
these are attempts to add path outside work tree, which should fail
loudly. These tests also have been fixed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
An earlier commit d089ebaa (setup: sanitize absolute and funny paths) made
get_pathspec() aware of absolute paths, but with a botched interface that
forced the callers to count the resulting pathspecs in order to detect
an error of giving a path that is outside the work tree.
This fixes it, by dying inside the function.
We had ls-tree test that relied on a misfeature in the original
implementation of its pathspec handling. Leading slashes were silently
removed from them. However we allow giving absolute pathnames (people
want to cut and paste from elsewhere) that are inside work tree these
days, so a pathspec that begin with slash _should_ be treated as a full
path. The test is adjusted to match the updated rule for get_pathspec().
Earlier I mistook three tests given by Robin that they should succeed, but
these are attempts to add path outside work tree, which should fail
loudly. These tests also have been fixed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c | diff | blob | history | |
t/t3101-ls-tree-dirname.sh | diff | blob | history | |
t/t7010-setup.sh | diff | blob | history |