add.c: extract new die_if_path_beyond_symlink() for reuse
[gitweb.git] / builtin / clean.c
index 0c7b3d0f4c28c9e9c721c961e529196751271d11..b098288ad151b5dc2dfdcb27f463215ca440f4e6 100644 (file)
@@ -97,9 +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[EXC_CMDL]);
+                           &dir.exclude_list_group[EXC_CMDL].el[0], -(i+1));
 
        pathspec = get_pathspec(prefix, argv);