Repository navigation
Restore the typed reset mode and the history controller's own import - #659
Merged
Merged
Conversation
Both were collateral from the bridging header cleanup, needed only while PBGitRepository.h still reached Swift through PBViewController.h. - Take GTRepositoryResetType in resetRefish: again. PBViewController.h now forward declares, so PBGitRepository.h no longer reaches the bridging header and the enum resolves. It also restores -Wswitch exhaustiveness: as NSInteger, a mode outside the three cases left modeParam nil and the argument array raised. - Import PBGitHistoryController.h in its own implementation again, instead of relying on it arriving transitively through PBWebHistoryController.h.
goneng
force-pushed
the
restore-typed-reset-mode
branch
from
September 17, 2026 21:03
0a6e2bc to
5878947
Compare
goneng
marked this pull request as ready for review
September 17, 2026 21:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two lines that #641 changed as collateral while
PBGitRepository.hstill reached Swiftthrough
PBViewController.h. That is no longer the case, so both can go back.Why the type matters
-Wswitchonly checks exhaustiveness on an enum-typed switch. Typing the parameterNSIntegerturned that check off silently. The same function, compiled both ways with thesame case deliberately omitted:
That matters here because the value falls straight into an array literal:
An unhandled mode leaves
modeParamnil, and a nil in an array literal raises and takes theapplication down, the same way #645, #648 and #654 did.
Not a live crash
There is one caller,
PBGitWindowController.m:782, and it passesGTRepositoryResetTypeSoft. Nothing reaches the gap today. What this restores is thecompile-time guard, so a fourth reset mode fails the build rather than shipping quietly.
The second change has no behavioural effect:
PBGitHistoryController.mimports its ownheader again instead of relying on it arriving through
PBWebHistoryController.h.Test plan
-Wswitchclaim