git: dont pass additional cwd

This commit is contained in:
Jörg Thalheim
2023-09-22 16:52:11 +02:00
parent b482dcd466
commit 0d42c549b0

View File

@@ -48,7 +48,7 @@ def _commit_file_to_git(repo_dir: Path, file_path: Path, commit_message: str) ->
) )
# add the file to the git index # add the file to the git index
try: try:
subprocess.run(cmd, cwd=repo_dir, check=True) subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
raise ClanError( raise ClanError(
f"Failed to add {file_path} to git repository {repo_dir}:\n{shlex.join(cmd)}\n exited with {e.returncode}" f"Failed to add {file_path} to git repository {repo_dir}:\n{shlex.join(cmd)}\n exited with {e.returncode}"
@@ -80,7 +80,6 @@ def _commit_file_to_git(repo_dir: Path, file_path: Path, commit_message: str) ->
try: try:
subprocess.run( subprocess.run(
cmd, cmd,
cwd=repo_dir,
check=True, check=True,
) )
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e: