Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Fix config install not working when .git* folder is in the path #8605

Merged
merged 8 commits into from Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions conans/client/conf/config_installer.py
Expand Up @@ -130,8 +130,6 @@ def _process_folder(config, folder, cache, output):
folder = os.path.join(folder, config.source_folder)
for root, dirs, files in walk(folder):
dirs[:] = [d for d in dirs if d != ".git"]
if ".git" in root:
continue
for f in files:
_process_file(root, f, config, cache, output, folder)

Expand Down
20 changes: 20 additions & 0 deletions conans/test/functional/command/config_install_test.py
Expand Up @@ -752,3 +752,23 @@ def test_config_install_remove_config_repo(self):
self.assertNotIn("Repo cloned!", self.client.out)
# ... and updates the next schedule
self.assertGreater(os.path.getmtime(self.client.cache.config_install_file), last_change)

def test_config_fails_git_folder(self):
# https://github.com/conan-io/conan/issues/8594
folder = os.path.join(temp_folder(), ".gitlab-conan", ".conan")
client = TestClient(cache_folder=folder)
with client.chdir(self.folder):
client.run_command('git init .')
client.run_command('git add .')
client.run_command('git config user.name myname')
client.run_command('git config user.email myname@mycompany.com')
client.run_command('git commit -m "mymsg"')
assert ".gitlab-conan" in client.cache_folder
assert os.path.basename(client.cache_folder) == ".conan"
conf = load(client.cache.conan_conf_path)
assert "config_install_interval = 5m" not in conf
client.run('config install "%s/.git" --type git' % self.folder)
conf = load(client.cache.conan_conf_path)
assert "config_install_interval = 5m" in conf
dirs = os.listdir(client.cache.cache_folder)
assert ".git" not in dirs