Merge pull request #768 from clopez/ignore_git_directories

Ignore any container named '.git'
This commit is contained in:
Stéphane Graber 2016-01-29 17:16:36 +01:00
commit 49dce6ec63

View File

@ -4188,9 +4188,9 @@ int list_defined_containers(const char *lxcpath, char ***names, struct lxc_conta
while (!readdir_r(dir, &dirent, &direntp)) {
if (!direntp)
break;
if (!strcmp(direntp->d_name, "."))
continue;
if (!strcmp(direntp->d_name, ".."))
// Ignore '.', '..' and any hidden directory
if (!strncmp(direntp->d_name, ".", 1))
continue;
if (!config_file_exists(lxcpath, direntp->d_name))