X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-clean.c;h=2d8c735d4881a005e4aa5006d9781b71631bb0af;hb=309883015ff3af6ce14ff9fe401e06cfce8adb13;hp=1c1b6d26e9987800d2a414e49e4f371a4277b96e;hpb=4197195bee15f120e99d797b22108fd274235fd7;p=git.git diff --git a/builtin-clean.c b/builtin-clean.c index 1c1b6d26e..2d8c735d4 100644 --- a/builtin-clean.c +++ b/builtin-clean.c @@ -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; @@ -78,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);