Avoid traversing git history for added files
commitb035fc586c571b893934548c696d2a6e6092505a
authorThomas Wolf <thomas.wolf@paranor.ch>
Thu, 14 Feb 2019 20:26:58 +0000 (14 21:26 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Thu, 14 Feb 2019 20:26:58 +0000 (14 21:26 +0100)
tree39b90b05728a81a5e0cb6f3abd1045864a3b9974
parentf87ec66f2bb9a3096faeaebc899e72d7bbced0e3
Avoid traversing git history for added files

"Compare with HEAD" for a file did search the whole git history even
for staged added files, which could be very expensive and on some
repositories can take very long indeed. Avoid this by checking first
whether the file exists at all in the HEAD commit, and only then try
to find the last commit that touched it. Otherwise return an empty
element.

Bug: 544404
Change-Id: Idc9e9e3ba80faeb94b96391c32f58b5365164b8a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java