Skip to content

Commit

Permalink
Fix test errors related to git config
Browse files Browse the repository at this point in the history
Not sure why it does not fail for all variants.
  • Loading branch information
sbidoul committed Oct 21, 2023
1 parent 8ff8603 commit 8eab385
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_oca_git_push_if_remote_did_not_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
def repo_dir(tmp_path_factory) -> str:
repo_path = tmp_path_factory.mktemp("repo")
subprocess.check_call(["git", "init"], cwd=repo_path)
subprocess.check_call(
["git", "config", "user.email", "[email protected]"],
cwd=repo_path,
)
subprocess.check_call(
["git", "config", "user.name", "test"],
cwd=repo_path,
)
(repo_path / "README").touch()
subprocess.check_call(["git", "add", "."], cwd=repo_path)
subprocess.check_call(["git", "commit", "-m", "initial commit"], cwd=repo_path)
Expand All @@ -24,6 +32,14 @@ def git_clone_path(repo_dir: str, tmp_path) -> Path:
subprocess.check_call(
["git", "clone", "--depth=1", "file://" + repo_dir, str(clone_path)]
)
subprocess.check_call(
["git", "config", "user.email", "[email protected]"],
cwd=clone_path,
)
subprocess.check_call(
["git", "config", "user.name", "test"],
cwd=clone_path,
)
return clone_path


Expand Down

0 comments on commit 8eab385

Please sign in to comment.