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

Function test_get_root_bare_worktree

tests/git_test.py:43–54  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

41
42
43def test_get_root_bare_worktree(tmpdir):
44 src = tmpdir.join('src').ensure_dir()
45 cmd_output('git', 'init', str(src))
46 git_commit(cwd=str(src))
47
48 bare = tmpdir.join('bare.git').ensure_dir()
49 cmd_output('git', 'clone', '--bare', str(src), str(bare))
50
51 cmd_output('git', 'worktree', 'add', 'foo', 'HEAD', cwd=bare)
52
53 with bare.join('foo').as_cwd():
54 assert git.get_root() == os.path.abspath('.')
55
56
57def test_get_git_dir(tmpdir):

Callers

nothing calls this directly

Calls 2

cmd_outputFunction · 0.90
git_commitFunction · 0.90

Tested by

no test coverage detected