Fix NPE when trying to show diff for a merge commit
commite5054ed2df20f4c5356cfde85013e52ed066f79b
authorThomas Wolf <thomas.wolf@paranor.ch>
Fri, 30 Dec 2016 09:46:47 +0000 (30 10:46 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Fri, 30 Dec 2016 09:46:47 +0000 (30 10:46 +0100)
treede26f3fcaf8d7cda97b42d09f31232dc8046927f
parentc78cc18772708ddd8507726ce0fc574cf540c110
Fix NPE when trying to show diff for a merge commit

JGit cannot compute meaningful diffs for merge commits. Display a
message saying so in the DiffEditorPage instead of throwing an NPE
(which would get caught, logged, and reported to the user in an error
dialog).

The alternative would have been to not add a DiffEditorPage at all for
merge commits, but I considered that confusing. Users would be left
wondering why for some commits no diff page was present.

Bug: 460442
Change-Id: I1af0a0b1f67c765025c5c0545b53c5df375eb08c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties