MCPcopy Create free account
hub / github.com/libgit2/pygit2 / _check_worktree

Function _check_worktree

test/test_repository.py:872–880  ·  view source on GitHub ↗
(worktree: Worktree)

Source from the content-addressed store, hash-verified

870 worktree_dir.rmdir()
871
872 def _check_worktree(worktree: Worktree) -> None:
873 # Confirm the name attribute matches the specified name
874 assert worktree.name == worktree_name
875 # Confirm the path attribute points to the correct path
876 assert Path(worktree.path).resolve() == worktree_dir.resolve()
877 # The "gitdir" in a worktree should be a file with a reference to
878 # the actual gitdir. Let's make sure that the path exists and is a
879 # file.
880 assert (worktree_dir / '.git').is_file()
881
882 # We should have zero worktrees
883 assert testrepo.list_worktrees() == []

Callers 1

test_worktreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…