]> git.ipfire.org Git - thirdparty/git.git/commit - dir.c
dir.c: git-clean -d -X: don't delete tracked directories
authorKarsten Blees <karsten.blees@gmail.com>
Mon, 15 Apr 2013 19:10:05 +0000 (21:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Apr 2013 19:34:00 +0000 (12:34 -0700)
commit5bd8e2d894be3a27e9b32b062ff224cc2396b69c
tree6fef740698678a93db1205804b825bf48cbf935e
parentbe8a84c526691667fc04a8241d93a3de1de298ab
dir.c: git-clean -d -X: don't delete tracked directories

The notion of "ignored tracked" directories introduced in 721ac4ed "dir.c:
Make git-status --ignored more consistent" has a few unwanted side effects:

 - git-clean -d -X: deletes ignored tracked directories. git-clean should
   never delete tracked content.

 - git-ls-files --ignored --other --directory: lists ignored tracked
   directories instead of "other" directories.

 - git-status --ignored: lists ignored tracked directories while contained
   files may be listed as modified. Paths listed by git-status should be
   disjoint (except in long format where a path may be listed in both the
   staged and unstaged section).

Additionally, the current behaviour violates documentation in gitignore(5)
("Specifies intentionally *untracked* files to ignore") and Documentation/
technical/api-directory-listing.txt ("DIR_SHOW_OTHER_DIRECTORIES: Include
a directory that is *not tracked*.").

In dir.c::treat_directory, remove the special handling of ignored tracked
directories, so that the DIR_SHOW_OTHER_DIRECTORIES flag only affects
"other" (i.e. untracked) directories. In dir.c::dir_add_name, check that
added paths are untracked even if DIR_SHOW_IGNORED is set.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
t/t3001-ls-files-others-exclude.sh
t/t7061-wtstatus-ignore.sh
t/t7300-clean.sh