DESCRIPTION

Use workspace file encoding in commit dialog diff

When viewing the diff (from the commit dialog) of a file that has a
different encoding than the workspace encoding, it contains incorrect
changes.

One way to reproduce this problem:

- Set the Eclipse workspace encoding to ISO-8859-1.
- Create an XML file that has an explicit UTF-8 encoding set (either
  through an encoding attribute in the XML or as an explicit property on
  the resource). Add some non-ASCII characters in the file.
- Commit it.
- Change some unrelated lines in the file.
- Open the commit dialog.
- View the diff of the file.

Before this change, the diff would show changes in the lines with
non-ASCII characters, even though they didn't change. The reason is that
the encoding of nextFile is correct because it is from the workspace.
But it's wrong for baseFile because it's read as a blob from the repo,
and the diff view therefore falls back to the wrong workspace encoding.

After this change, the encoding from the IFile is also used to decode
the previous file contents, and the diff is correct.

Change-Id: I58ba71d30d7dd47068d2b212737896f6c1b9843a


COMMENTS

author: Brenden Conley
date: 2011-05-04 13:28:09.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2011-05-04 13:35:51.000000000

Patch Set 1: I would prefer that you didn't submit this

Build Unstable 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/616/ : UNSTABLE

-------------------------------------
author: Carlie Harper
date: 2011-05-09 15:22:50.000000000

Patch Set 1: Looks good to me, approved; Build Successful; IP review completed

Great, this works well.

In a future change we should make use of this in all the other places where we compare content:
- Compare With commands
- History View commands
- the new Staging View
- the places I forgot

-------------------------------------
author: Carlie Harper
date: 2011-05-09 15:22:51.000000000

Change has been successfully merged into the git repository.

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