Merge branch 'fc/transport-helper-error-reporting'
[gitweb.git] / builtin / clean.c
index f4b760bf3dcb2371da6ae9d77f2f8fb1c0fa9eb9..04e396b17acc2443a663dd085ef812c3c2746d27 100644 (file)
@@ -153,6 +153,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        static const char **pathspec;
        struct strbuf buf = STRBUF_INIT;
        struct string_list exclude_list = STRING_LIST_INIT_NODUP;
+       struct exclude_list *el;
        const char *qname;
        char *seen = NULL;
        struct option options[] = {
@@ -205,9 +206,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
        if (!ignored)
                setup_standard_excludes(&dir);
 
+       el = 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[EXC_CMDL]);
+               add_exclude(exclude_list.items[i].string, "", 0, el, -(i+1));
 
        pathspec = get_pathspec(prefix, argv);