issue #7520 : fix MissingObjectException when switching git projects#7531
Merged
Conversation
…jects Clear Git Perspective UI state before rebuild on root change, close the previous JGit repository when opening another, and treat foreign commit ids as not-in-branch instead of logging MissingObjectException.
Contributor
|
Going to keep this open until we have a reply in #7520, as I do not have the correct setup to properly test this fix. |
mattcasters
marked this pull request as draft
July 15, 2026 13:11
Contributor
Author
|
Set to draft until we have confirmation. |
hansva
marked this pull request as ready for review
July 16, 2026 08:57
Contributor
|
Merging as he can't test on code only, this way he will have a snapshot build |
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.
What
Fixes
org.eclipse.jgit.errors.MissingObjectExceptionin the Git Perspective when switching Hop projects (or explorer roots) that map to different local git repositories.Root cause
The Git Perspective is a long-lived singleton. On project switch it opened the new repository and then called
updateGui()while the history table still heldRevCommitselection from the previous repo.isCommitInCurrentBranchre-parsed those ids against the newly opened object database →Missing unknown <other-project-SHA>.This is a 2.18 Git Perspective lifecycle bug, not a general JGit inability to read commit-graph / multi-pack-index / bitmaps. See the analysis on #7520.
Changes
updateGui()last.UIGitrepository onrootChanged(null-safecloseRepo()).objectDatabase.has(id)/ quietMissingObjectExceptionfor foreign ids.How was this tested?
./mvnw -pl plugins/misc/git -am test -Dtest=GitPerspectiveBranchCheckTest -Dsurefire.failIfNoSpecifiedTests=falseRelated
Fixes #7520