Repository navigation
Fix GitX quitting when its history cannot be loaded - #654
Merged
Merged
Conversation
The error that ends the load is already in hand, so report it and keep what was read rather than raising on it. * Replace the NSAssert ending -addCommitsFromEnumerator: with the log this class already uses for a failed push. NS_BLOCK_ASSERTIONS is unset in Release, so a repository deleted, moved or unmounted under an open window raised NSInternalInconsistencyException and took the application down with nothing said about the cause. * Let the partial walk flush, so the commits read before the failure reach the history list instead of being lost with the exception. * Add PBGitRevListEnumerationErrorTests, driving the walk with an enumerator that reports failure immediately.
goneng
force-pushed
the
fix-commit-walk-error-reporting
branch
from
September 15, 2026 18:41
08eadcb to
43353c2
Compare
goneng
marked this pull request as ready for review
September 15, 2026 18:45
Contributor
|
Sounds like an edge case. Let's give it a try |
This was referenced Sep 15, 2026
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.
Deleting, moving, renaming or unmounting a repository under an open window
makes GitX quit while it refreshes the history: no sheet, no message, the
window is simply gone. The error that ends the load is already in hand, but
the load ended on an assertion instead of reporting it.
Fixes #645, where the diagnosis is written up in full.
Changes
NSAssertending-addCommitsFromEnumerator:with the log thisclass already uses for a failed push.
NS_BLOCK_ASSERTIONSis unset inRelease, so this was not Debug-only: the failure raised
NSInternalInconsistencyExceptionand took the application down.the history list instead of being lost with the exception, so the window
keeps the history it had rather than emptying.
PBGitRevListEnumerationErrorTests, which drives the load with anenumerator that reports failure immediately.
-addCommitsFromEnumerator:only ever asks for the next OID, so the test needs no repository behind it,
following
PBGitRevListRaceConditionTests.Test plan
make unit-testfails on the new test before the source change, throwingNSInternalInconsistencyException: Error enumerating commits, and passesafter it: 127 tests green.
surfaced rather than merely not thrown:
Failed to enumerate commits: Error Domain=GTGitErrorDomain Code=-1 "the walk could not be continued".PBGitRevListRaceConditionTestsstill passes, so nothing in this classrelied on the assertion firing.
Note that this reports to the console, matching how the rest of the class
handles a failed push. Surfacing it to the user would need a channel this
class does not have, since
loadRevisionsWithCompletionBlock:takes a barevoidblock, and that is a larger change than the issue describes.