mattcasters opened a new pull request, #7531: URL: https://github.com/apache/hop/pull/7531
## What Fixes `org.eclipse.jgit.errors.MissingObjectException` in 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 held `RevCommit` selection from the **previous** repo. `isCommitInCurrentBranch` re-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 - **A:** Clear ref/history/file UI state first on refresh; rebuild for the current repo; call `updateGui()` last. - **B:** Close the previous `UIGit` repository on `rootChanged` (null-safe `closeRepo()`). - **C:** Harden branch membership check: `objectDatabase.has(id)` / quiet `MissingObjectException` for foreign ids. - Small headless JGit unit test for the branch-check helper (two temp repos; no native git, no SWT). ## How was this tested? - `./mvnw -pl plugins/misc/git -am test -Dtest=GitPerspectiveBranchCheckTest -Dsurefire.failIfNoSpecifiedTests=false` - Compile of the git plugin module ## Related Fixes #7520 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
