-
Notifications
You must be signed in to change notification settings - Fork 91
If a solution exists but we want to remove it it should be deleted from the remote #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -919,7 +919,9 @@ def sync(self, ignore: tuple[str] = ()) -> None: | |||||||
| self._set_next(_next) | ||||||||
|
|
||||||||
| if "solution" not in ignore: | ||||||||
| # self._delete_existing_solution() | ||||||||
| resolved_solution = self._resolve_solution_path() | ||||||||
| if not resolved_solution: | ||||||||
| self._delete_existing_solution() | ||||||||
| self._create_solution() | ||||||||
|
||||||||
| self._create_solution() | |
| else: | |
| self._create_solution() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution sync logic has inefficiencies and inconsistencies compared to other fields:
Duplicate path resolution:
_resolve_solution_path()is called twice - once here and once inside_create_solution(). This happens in both cases (solution exists or not).Pattern inconsistency: This doesn't follow the established pattern used for flags (lines 847-850), topics (lines 853-856), tags (lines 859-862), and hints (lines 907-910), which always delete then conditionally create.
Consider restructuring to match the established pattern:
_delete_existing_solution()_create_solution()(which already returns early if no solution)This would eliminate the duplicate path resolution and improve code consistency.