author | Jeff King <peff@peff.net> | |
Thu, 16 Oct 2008 15:07:26 +0000 (11:07 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 17 Oct 2008 19:46:59 +0000 (12:46 -0700) | ||
commit | 98fa473887d0bebd38d568bb07232a336a642dcf | |
tree | bce65b20193d1fc4f51ca64d6bdad4718609ff29 | tree | snapshot |
parent | 8ed0a740dd42bd0724aebed6e3b07c4ea2a2d5e8 | commit | diff |
refactor handling of "other" files in ls-files and status
When the "git status" display code was originally converted
to C, we copied the code from ls-files to discover whether a
pathname returned by read_directory was an "other", or
untracked, file.
Much later, 5698454e updated the code in ls-files to handle
some new cases caused by gitlinks. This left the code in
wt-status.c broken: it would display submodule directories
as untracked directories. Nobody noticed until now, however,
because unless status.showUntrackedFiles was set to "all",
submodule directories were not actually reported by
read_directory. So the bug was only triggered in the
presence of a submodule _and_ this config option.
This patch pulls the ls-files code into a new function,
cache_name_is_other, and uses it in both places. This should
leave the ls-files functionality the same and fix the bug
in status.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When the "git status" display code was originally converted
to C, we copied the code from ls-files to discover whether a
pathname returned by read_directory was an "other", or
untracked, file.
Much later, 5698454e updated the code in ls-files to handle
some new cases caused by gitlinks. This left the code in
wt-status.c broken: it would display submodule directories
as untracked directories. Nobody noticed until now, however,
because unless status.showUntrackedFiles was set to "all",
submodule directories were not actually reported by
read_directory. So the bug was only triggered in the
presence of a submodule _and_ this config option.
This patch pulls the ls-files code into a new function,
cache_name_is_other, and uses it in both places. This should
leave the ls-files functionality the same and fix the bug
in status.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-ls-files.c | diff | blob | history | |
cache.h | diff | blob | history | |
read-cache.c | diff | blob | history | |
t/t7502-status.sh | diff | blob | history | |
wt-status.c | diff | blob | history |