X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Fclean.c;h=fb24030751ec5e755009a97439ffa08ff55f67d5;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=b508d2cab482dffc97be1e8ee0481a6bb6157cf2;hpb=d25c72f7da5116f7b7a1f88a59d2bc14415a03b2;p=git.git diff --git a/builtin/clean.c b/builtin/clean.c index b508d2cab..fb2403075 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -38,13 +38,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix) { int i; int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0; - int ignored_only = 0, baselen = 0, config_set = 0, errors = 0; + int ignored_only = 0, config_set = 0, errors = 0; int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT; struct strbuf directory = STRBUF_INIT; struct dir_struct dir; static const char **pathspec; struct strbuf buf = STRBUF_INIT; - struct string_list exclude_list = { NULL, 0, 0, 0 }; + struct string_list exclude_list = STRING_LIST_INIT_NODUP; const char *qname; char *seen = NULL; struct option options[] = { @@ -138,7 +138,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) if (pathspec) { memset(seen, 0, argc > 0 ? argc : 1); matches = match_pathspec(pathspec, ent->name, len, - baselen, seen); + 0, seen); } if (S_ISDIR(st.st_mode)) { @@ -153,7 +153,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) printf("Removing %s\n", qname); if (remove_dir_recursively(&directory, rm_flags) != 0) { - warning("failed to remove '%s'", qname); + warning("failed to remove %s", qname); errors++; } } else if (show_only) { @@ -173,7 +173,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) printf("Removing %s\n", qname); } if (unlink(ent->name) != 0) { - warning("failed to remove '%s'", qname); + warning("failed to remove %s", qname); errors++; } }