6 """ Portable python script to execute git -C (even on system where -C is not available) """
16 [executable,
"-C", path,
"status"],
17 stdout=subprocess.PIPE,
18 stderr=subprocess.PIPE,
22 except subprocess.CalledProcessError:
28 called = subprocess.run(args, check=
True)
29 sys.exit(called.returncode)
30 except subprocess.CalledProcessError
as e:
31 sys.exit(e.returncode)
35 if len(sys.argv) <= 3:
37 "Usage: {} <git_executable_path> <repo_path> [git_args...]".format(
44 repo_path = sys.argv[2]
47 return git_exe, repo_path, args
51 git_exe, repo_path, args =
parse()
60 if __name__ ==
"__main__":
def simple_git_execution(args)
def isCArgSupported(executable, path)