Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354507

Summary: "Show blame annotations" fails when working on renamed files
Product: [Technology] JGit Reporter: Christian Halstrick <christian.halstrick>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: KevinSawicki, matthias.sohn
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
a repo containing a renamed file none

Description Christian Halstrick CLA 2011-08-11 10:51:34 EDT
When trying to inspect blame annotations on a file which was renamed before I get an error dialog saying "'Computing blame annotations' has encountered a problem ....".

Steps to reproduce:
- unpack the attached repo
- import the project in the repo into latest EGit
- in EGit navigate to /DemoCalc/src/xyz/com/test/Calc.java
- rightclick on the file and select "Team->Show blame annotations"
-> an error dialog pops up and the error log contains a stacktrace like this:

java.lang.IllegalStateException: Renames have already been found.
	at org.eclipse.jgit.diff.RenameDetector.addAll(RenameDetector.java:245)
	at org.eclipse.jgit.blame.BlameGenerator.findRename(BlameGenerator.java:948)
	at org.eclipse.jgit.blame.BlameGenerator.processOne(BlameGenerator.java:589)
	at org.eclipse.jgit.blame.BlameGenerator.next(BlameGenerator.java:479)
	at org.eclipse.jgit.blame.BlameResult.computeAll(BlameResult.java:239)
	at org.eclipse.jgit.blame.BlameGenerator.computeBlameResult(BlameGenerator.java:433)
	at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:220)
	at org.eclipse.egit.ui.internal.blame.BlameOperation.execute(BlameOperation.java:82)
	at org.eclipse.egit.ui.internal.job.JobUtil$1.run(JobUtil.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Christian Halstrick CLA 2011-08-11 10:52:50 EDT
Created attachment 201320 [details]
a repo containing a renamed file
Comment 2 Kevin Sawicki CLA 2011-09-01 16:30:34 EDT
Proposed fix pushed to: http://egit.eclipse.org/r/#change,4118
Comment 3 Matthias Sohn CLA 2011-09-03 17:42:24 EDT
merged as d110fbc300fe32b00a491e6471d5534f4615b87b