Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e305ef9

Browse files
committed
test(conftest): disable 'safe.directory' Git config for container bound sources
Details: The git sources folder ownership may be detected as dubious if running in a container with sources mounted to work on fixes and tests, breaking 'test_find_git_project_root' and 'test_get_commits_with_signature' > commitizen.exceptions.GitCommandError: fatal: detected dubious ownership in repository at '...' --- Signed-off-by: Adrian DC <radian.dc@gmail.com>
1 parent 689aef5 commit e305ef9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎tests/conftest.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@ def git_sandbox(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
3535
gitconfig = tmp_path / ".git" / "config"
3636
if not gitconfig.parent.exists():
3737
gitconfig.parent.mkdir()
38+
3839
monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(gitconfig))
40+
3941
r = cmd.run(f"git config --file {gitconfig} user.name {SIGNER}")
4042
assert r.return_code == 0, r.err
4143
r = cmd.run(f"git config --file {gitconfig} user.email {SIGNER_MAIL}")
4244
assert r.return_code == 0, r.err
43-
cmd.run("git config --global init.defaultBranch master")
45+
46+
r = cmd.run(f"git config --file {gitconfig} safe.directory '*'")
47+
assert r.return_code == 0, r.err
48+
49+
r = cmd.run("git config --global init.defaultBranch master")
50+
assert r.return_code == 0, r.err
4451

4552

4653
@pytest.fixture

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /