Skip to content

Commit 1efbebd

Browse files
committed
exc(refactor) Remove unused worktree exception classes
why: WorktreeExistsError, WorktreeRefNotFoundError, and WorktreeDirtyError are never imported, raised, or caught anywhere in the codebase. The worktree sync code uses WorktreeSyncResult entries with error strings instead. what: - Remove WorktreeExistsError class - Remove WorktreeRefNotFoundError class - Remove WorktreeDirtyError class - Keep WorktreeError (base) and WorktreeConfigError (actively used)
1 parent bec05d7 commit 1efbebd

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/vcspull/exc.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,8 @@ class WorktreeError(VCSPullException):
1717
"""Base exception for worktree operations."""
1818

1919

20-
class WorktreeExistsError(WorktreeError):
21-
"""Worktree already exists at the specified path."""
22-
23-
def __init__(self, path: str, *args: object, **kwargs: object) -> None:
24-
super().__init__(f"Worktree already exists at path: {path}")
25-
self.path = path
26-
27-
28-
class WorktreeRefNotFoundError(WorktreeError):
29-
"""Reference (tag, branch, or commit) not found in repository."""
30-
31-
def __init__(
32-
self,
33-
ref: str,
34-
ref_type: str,
35-
repo_path: str,
36-
*args: object,
37-
**kwargs: object,
38-
) -> None:
39-
super().__init__(
40-
f"{ref_type.capitalize()} '{ref}' not found in repository at {repo_path}"
41-
)
42-
self.ref = ref
43-
self.ref_type = ref_type
44-
self.repo_path = repo_path
45-
46-
4720
class WorktreeConfigError(WorktreeError):
4821
"""Invalid worktree configuration."""
4922

5023
def __init__(self, message: str, *args: object, **kwargs: object) -> None:
5124
super().__init__(message)
52-
53-
54-
class WorktreeDirtyError(WorktreeError):
55-
"""Worktree has uncommitted changes and cannot be modified."""
56-
57-
def __init__(self, path: str, *args: object, **kwargs: object) -> None:
58-
super().__init__(f"Worktree at {path} has uncommitted changes")
59-
self.path = path

0 commit comments

Comments
 (0)