in fluent/migrate/repo_client.py [0:0]
def git(root: str, *args: str) -> str:
"""
Wrapper for calling command-line git in the `root` directory.
Raises an exception on any error, including a non-0 return code.
Returns the command's stdout as a string.
"""
git = ["git"]
git.extend(args)
proc = run(git, capture_output=True, cwd=root, encoding="utf-8")
if proc.returncode != 0:
raise Exception(proc.stderr or f"git command failed: {args}")
return proc.stdout