MCPcopy
hub / github.com/Aider-AI/aider / set_git_env

Function set_git_env

aider/repo.py:40–49  ·  view source on GitHub ↗

Temporarily set a Git environment variable.

(var_name, value, original_value)

Source from the content-addressed store, hash-verified

38
39@contextlib.contextmanager
40def set_git_env(var_name, value, original_value):
41 """Temporarily set a Git environment variable."""
42 os.environ[var_name] = value
43 try:
44 yield
45 finally:
46 if original_value is not None:
47 os.environ[var_name] = original_value
48 elif var_name in os.environ:
49 del os.environ[var_name]
50
51
52class GitRepo:

Callers 1

commitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected