diff options
author | Shawn Bohrer <shawn.bohrer@gmail.com> | 2007-11-14 23:00:54 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-18 19:11:42 -0800 |
commit | 1617adc7a074415413b2f48da72f43d5c6cd74c4 (patch) | |
tree | 4f1db1381a0277781e2a7cf9305a0eb50a5914f1 /builtin-clean.c | |
parent | 625db1b7530b621f32b0ef1ef502a09a05872f5d (diff) | |
download | git-1617adc7a074415413b2f48da72f43d5c6cd74c4.tar.gz git-1617adc7a074415413b2f48da72f43d5c6cd74c4.tar.xz |
Teach git clean to use setup_standard_excludes()
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-clean.c')
-rw-r--r-- | builtin-clean.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/builtin-clean.c b/builtin-clean.c index 8da6f3c63..56ae4eb9b 100644 --- a/builtin-clean.c +++ b/builtin-clean.c @@ -22,7 +22,7 @@ static int git_clean_config(const char *var, const char *value) { if (!strcmp(var, "clean.requireforce")) force = !git_config_bool(var, value); - return 0; + return git_default_config(var, value); } int cmd_clean(int argc, const char **argv, const char *prefix) @@ -55,10 +55,8 @@ int cmd_clean(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, options, builtin_clean_usage, 0); memset(&dir, 0, sizeof(dir)); - if (ignored_only) { - dir.show_ignored =1; - dir.exclude_per_dir = ".gitignore"; - } + if (ignored_only) + dir.show_ignored = 1; if (ignored && ignored_only) die("-x and -X cannot be used together"); @@ -69,13 +67,8 @@ int cmd_clean(int argc, const char **argv, const char *prefix) dir.show_other_directories = 1; - if (!ignored) { - dir.exclude_per_dir = ".gitignore"; - if (!access(git_path("info/exclude"), F_OK)) { - char *exclude_path = git_path("info/exclude"); - add_excludes_from_file(&dir, exclude_path); - } - } + if (!ignored) + setup_standard_excludes(&dir); pathspec = get_pathspec(prefix, argv); read_cache(); |