DESCRIPTION

Fix GitQuickDiffProvider creating multiple GitDocuments for resource

getReference didn't check whether a document was already created, and
just created a new one, overwriting the already existing one.

This resulted in the existing GitDocument never being disposed, which in
turn caused unnecessary work being done in GitDocument#onRefsChanged,
slowing down operations.

That GitQuickDiffProvider#getReference can be called multiple times can
be seen by adding a breakpoint and then doing this:

1. Show annotations in a tracked file -> first call
2. Edit the file
3. Commit the changes -> second call

The check for RepositoryProvider can be removed as it's done anyway in
GitDocument.create.

Bug: 413497
Change-Id: Iad7b39b85e365a7729316b6dbbbe99c25057147c
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Danika Greer
date: 2014-04-06 17:28:05.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-04-06 17:28:11.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/5702/

-------------------------------------
author: Brenden Conley
date: 2014-04-06 17:41:39.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/5702/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2014-04-07 06:38:07.000000000

Patch Set 1: Code-Review+2 IP-Clean+1

verified using memory analyzer https://www.eclipse.org/mat/

-------------------------------------
author: Douglas Trujillo
date: 2014-04-07 06:38:09.000000000

Change has been successfully merged into the git repository.

-------------------------------------
