Code

am: format is in $patch_format, not parse_patch
[git.git] / builtin-clean.c
index c5ad33d3e665f6d1613df2dfba235b03765565ac..2d8c735d4881a005e4aa5006d9781b71631bb0af 100644 (file)
@@ -33,7 +33,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        int ignored_only = 0, baselen = 0, config_set = 0, errors = 0;
        struct strbuf directory = STRBUF_INIT;
        struct dir_struct dir;
-       const char *path, *base;
        static const char **pathspec;
        struct strbuf buf = STRBUF_INIT;
        const char *qname;
@@ -56,7 +55,8 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        else
                config_set = 1;
 
-       argc = parse_options(argc, argv, options, builtin_clean_usage, 0);
+       argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
+                            0);
 
        memset(&dir, 0, sizeof(dir));
        if (ignored_only)
@@ -77,16 +77,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        pathspec = get_pathspec(prefix, argv);
        read_cache();
 
-       /*
-        * Calculate common prefix for the pathspec, and
-        * use that to optimize the directory walk
-        */
-       baselen = common_prefix(pathspec);
-       path = ".";
-       base = "";
-       if (baselen)
-               path = base = xmemdupz(*pathspec, baselen);
-       read_directory(&dir, path, base, baselen, pathspec);
+       fill_directory(&dir, pathspec);
 
        if (pathspec)
                seen = xmalloc(argc > 0 ? argc : 1);