Useful indeed.
Note that 'git clean -n -d ' however will still report the directory as
being removed. Also, I'm not sure what happens (and what should happen)
if an untracked directory foo.git is found.
Probably the best way to fix this is to add an is_dot_git_path function
to dir.c like this
int
is_dot_git_path (const char *s, int len);
{
while (len && s[len - 1] == '/')
len--;
return len >= 4 && !memcmp (s + len - 4, ".git", 5) &&
(len == 4 || s[len - 5] == '/');
}
This function is safer if the directory does not have a trailing slash,
as it might be for the paths in builtin-clean.c for the -n case. You
can have some adjustments if you decide do keep foo.git (just removing
the last && of course).
Thanks!
Paolo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html