class documentation
Information about a single worktree.
| Method | __eq__ |
Check equality with another WorkTreeInfo. |
| Method | __init__ |
Initialize WorkTreeInfo. |
| Method | __repr__ |
Return string representation of WorkTreeInfo. |
| Method | open |
Open this worktree as a WorkTree. |
| Instance Variable | bare |
Whether this is a bare repository |
| Instance Variable | branch |
Current branch (if not detached) |
| Instance Variable | detached |
Whether HEAD is detached |
| Instance Variable | head |
Current HEAD commit SHA |
| Instance Variable | lock |
Reason for locking (if locked) |
| Instance Variable | locked |
Whether the worktree is locked |
| Instance Variable | path |
Path to the worktree |
| Instance Variable | prunable |
Whether the worktree can be pruned |
def __init__(self, path:
str, head: bytes | None = None, branch: Ref | None = None, bare: bool = False, detached: bool = False, locked: bool = False, prunable: bool = False, lock_reason: str | None = None):
¶
Initialize WorkTreeInfo.
| Parameters | |
path:str | Path to the worktree |
head:bytes | None | Current HEAD commit SHA |
branch:Ref | None | Current branch (if not detached) |
bare:bool | Whether this is a bare repository |
detached:bool | Whether HEAD is detached |
locked:bool | Whether the worktree is locked |
prunable:bool | Whether the worktree can be pruned |
lockstr | None | Reason for locking (if locked) |
Open this worktree as a WorkTree.
| Returns | |
WorkTree | WorkTree object for this worktree |
| Raises | |
NotGitRepository | If the worktree path is invalid |