Bug 576049 - NPE in Blame on renaming master
Summary: NPE in Blame on renaming master
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.13   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 5.13.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 576343 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-17 01:35 EDT by Michael Keppler CLA
Modified: 2021-10-04 13:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keppler CLA 2021-09-17 01:35:50 EDT
egit 5.13 introduced updating the blame information dynamically. The listener throws an NPE immediately when the master branch is renamed, since it assumes that ref to be resolvable any time.

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.blame.BlameOperation$1.onRefsChanged(BlameOperation.java:479)
	at org.eclipse.jgit.events.RefsChangedEvent.dispatch(RefsChangedEvent.java:26)
	at org.eclipse.jgit.events.RefsChangedEvent.dispatch(RefsChangedEvent.java:1)
	at org.eclipse.jgit.events.ListenerList.dispatch(ListenerList.java:100)
	at org.eclipse.egit.core.RepositoryHandle.fireEvent(RepositoryHandle.java:135)
	at org.eclipse.egit.core.RepositoryHandle.lambda$2(RepositoryHandle.java:114)
	at org.eclipse.jgit.events.RefsChangedEvent.dispatch(RefsChangedEvent.java:26)
	at org.eclipse.jgit.events.RefsChangedEvent.dispatch(RefsChangedEvent.java:1)
	at org.eclipse.jgit.events.ListenerList.dispatch(ListenerList.java:100)
	at org.eclipse.jgit.lib.Repository.fireEvent(Repository.java:167)
	at org.eclipse.jgit.internal.storage.file.RefDirectory.fireRefsChanged(RefDirectory.java:1193)
	at org.eclipse.jgit.internal.storage.file.RefDirectory.delete(RefDirectory.java:658)
	at org.eclipse.jgit.internal.storage.file.RefDirectoryRename.doRename(RefDirectoryRename.java:148)
	at org.eclipse.jgit.lib.RefRename.rename(RefRename.java:128)
	at org.eclipse.jgit.api.RenameBranchCommand.call(RenameBranchCommand.java:126)
	at org.eclipse.egit.core.op.RenameBranchOperation$1.run(RenameBranchOperation.java:67)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338)
	at org.eclipse.egit.core.op.RenameBranchOperation.execute(RenameBranchOperation.java:74)
	at org.eclipse.egit.ui.internal.dialogs.BranchRenameDialog.buttonPressed(BranchRenameDialog.java:134)
Comment 1 Michael Keppler CLA 2021-09-17 01:45:15 EDT
Besides the NPE, the interrupted rename operation left my repo in a very confusing state. All files were marked as new and many operations fail because there is no previous commit, both in egit and cli git.
Checking out a remote branch again restores the normal behaviour.
Comment 2 Eclipse Genie CLA 2021-09-17 03:02:48 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185535
Comment 4 Matthias Sohn CLA 2021-10-04 13:22:04 EDT
*** Bug 576343 has been marked as a duplicate of this bug. ***