MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / cwd

Function cwd

testing/util.py:90–96  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

88
89@contextlib.contextmanager
90def cwd(path):
91 original_cwd = os.getcwd()
92 os.chdir(path)
93 try:
94 yield
95 finally:
96 os.chdir(original_cwd)
97
98
99def git_commit(*args, fn=cmd_output, msg='commit!', all_files=True, **kwargs):

Callers 15

test_cloneFunction · 0.90
in_tmpdirFunction · 0.90
in_merge_conflictFunction · 0.90
in_conflicting_submoduleFunction · 0.90
commit_msg_repoFunction · 0.90
prepare_commit_msg_repoFunction · 0.90
test_install_on_substFunction · 0.90
repo_with_commitsFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_cloneFunction · 0.72
in_tmpdirFunction · 0.72
in_merge_conflictFunction · 0.72
in_conflicting_submoduleFunction · 0.72
commit_msg_repoFunction · 0.72
prepare_commit_msg_repoFunction · 0.72
test_install_on_substFunction · 0.72
repo_with_commitsFunction · 0.72