diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-05-09 22:43:01 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-10 09:04:26 -0700 |
commit | 28911091c120365a415f4cef8a21a5fa450b5fef (patch) | |
tree | c47717d761f182d48f27f2a3dab210e585a7e83b /builtin/merge-file.c | |
parent | t1011: fix sparse-checkout initialization and add new file (diff) | |
download | tgif-28911091c120365a415f4cef8a21a5fa450b5fef.tar.xz |
sparse checkout: do not eagerly decide the fate for whole directory
Sparse-setting code follows closely how files are excluded in
read_directory(), every entry (including directories) are fed to
excluded_from_list() to decide if the entry is suitable. Directories
are treated no different than files. If a directory is matched (or
not), the whole directory is considered matched (or not) and the
process moves on.
This generally works as long as there are no patterns to exclude parts
of the directory. In case of sparse checkout code, the following patterns
t
!t/t0000-basic.sh
will produce a worktree with full directory "t" even if t0000-basic.sh
is requested to stay out.
By the same reasoning, if a directory is to be excluded, any rules to
re-include certain files within that directory will be ignored.
Fix it by always checking files against patterns. If no pattern can be
used to decide whether an entry is in our out
(ie. excluded_from_list() returns -1), the entry will be
included/excluded the same as their parent directory.
Noticed-by: <skillzero@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-file.c')
0 files changed, 0 insertions, 0 deletions