diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-23 11:21:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-23 11:21:23 -0700 |
commit | 7093d2c0dd986c70a98b712440b34f98599b3539 (patch) | |
tree | d4c22d38c71d388dce709fc36d6318ca873f9570 /builtin/add.c | |
parent | Merge branch 'jn/gitweb-install-doc' (diff) | |
parent | dir.c: git-status --ignored: don't scan the work tree twice (diff) | |
download | tgif-7093d2c0dd986c70a98b712440b34f98599b3539.tar.xz |
Merge branch 'kb/status-ignored-optim-2'
Fixes a handful of issues in the code to traverse working tree to
find untracked and/or ignored files, cleans up and optimizes the
codepath in general.
* kb/status-ignored-optim-2:
dir.c: git-status --ignored: don't scan the work tree twice
dir.c: git-status --ignored: don't scan the work tree three times
dir.c: git-status: avoid is_excluded checks for tracked files
dir.c: replace is_path_excluded with now equivalent is_excluded API
dir.c: unify is_excluded and is_path_excluded APIs
dir.c: move prep_exclude
dir.c: factor out parts of last_exclude_matching for later reuse
dir.c: git-clean -d -X: don't delete tracked directories
dir.c: make 'git-status --ignored' work within leading directories
dir.c: git-status --ignored: don't list empty directories as ignored
dir.c: git-ls-files --directories: don't hide empty directories
dir.c: git-status --ignored: don't list empty ignored directories
dir.c: git-status --ignored: don't list files in ignored directories
dir.c: git-status --ignored: don't drop ignored directories
Diffstat (limited to 'builtin/add.c')
-rw-r--r-- | builtin/add.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/add.c b/builtin/add.c index 54cd2d417d..d4b40f2b7a 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -545,9 +545,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (pathspec) { int i; - struct path_exclude_check check; - path_exclude_check_init(&check, &dir); if (!seen) seen = find_pathspecs_matching_against_index(pathspec); for (i = 0; pathspec[i]; i++) { @@ -555,7 +553,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) && !file_exists(pathspec[i])) { if (ignore_missing) { int dtype = DT_UNKNOWN; - if (is_path_excluded(&check, pathspec[i], -1, &dtype)) + if (is_excluded(&dir, pathspec[i], &dtype)) dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i])); } else die(_("pathspec '%s' did not match any files"), @@ -563,7 +561,6 @@ int cmd_add(int argc, const char **argv, const char *prefix) } } free(seen); - path_exclude_check_clear(&check); } plug_bulk_checkin(); |