pathspec.c: rename newly public functions for clarity
[gitweb.git] / builtin / clean.c
index 75697f711116e42df1e21e608c21829f49549b08..b098288ad151b5dc2dfdcb27f463215ca440f4e6 100644 (file)
@@ -54,7 +54,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
                OPT_BOOLEAN('d', NULL, &remove_directories,
                                "remove whole directories"),
                { OPTION_CALLBACK, 'e', "exclude", &exclude_list, "pattern",
-                 "exclude <pattern>", PARSE_OPT_NONEG, exclude_cb },
+                 "add <pattern> to ignore rules", PARSE_OPT_NONEG, exclude_cb },
                OPT_BOOLEAN('x', NULL, &ignored, "remove ignored files, too"),
                OPT_BOOLEAN('X', NULL, &ignored_only,
                                "remove only ignored files"),
@@ -97,8 +97,10 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        if (!ignored)
                setup_standard_excludes(&dir);
 
+       add_exclude_list(&dir, EXC_CMDL, "--exclude option");
        for (i = 0; i < exclude_list.nr; i++)
-               add_exclude(exclude_list.items[i].string, "", 0, dir.exclude_list);
+               add_exclude(exclude_list.items[i].string, "", 0,
+                           &dir.exclude_list_group[EXC_CMDL].el[0], -(i+1));
 
        pathspec = get_pathspec(prefix, argv);