Re: [PATCH v5 6/6] clean: teach clean -d to preserve ignored paths

2017-05-23 Thread Samuel Lijin
On Tue, May 23, 2017 at 8:52 AM, Junio C Hamano wrote: > Samuel Lijin writes: > >> @@ -931,6 +961,7 @@ int cmd_clean(int argc, const char **argv, const char >> *prefix) >> prefix, argv); >> >> fill_directory(, ); >> +

Re: [PATCH v5 6/6] clean: teach clean -d to preserve ignored paths

2017-05-23 Thread Junio C Hamano
Samuel Lijin writes: > @@ -931,6 +961,7 @@ int cmd_clean(int argc, const char **argv, const char > *prefix) > prefix, argv); > > fill_directory(, ); > + correct_untracked_entries(); > > for (i = 0; i < dir.nr; i++) { >

[PATCH v5 6/6] clean: teach clean -d to preserve ignored paths

2017-05-23 Thread Samuel Lijin
There is an implicit assumption that a directory containing only untracked and ignored paths should itself be considered untracked. This makes sense in use cases where we're asking if a directory should be added to the git database, but not when we're asking if a directory can be safely removed