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

Bug 352940

Summary: Can not compare staged files
Product: [Technology] EGit Reporter: boegner-online
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 1.0   
Target Milestone: 1.2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description boegner-online CLA 2011-07-23 15:46:47 EDT
Short:
1. Take a local repository.
2. Check out master branch.
3. Delete a file (local).
4. Use synchronize view to synchronize the checked out branch.
5. Select "Git change set" from the button with tree icon.
6. Ecpand all branches.
7. Look for the deleted file under the "<staged changes>" branch.
8. Double click it.
-> Error message dialog should appear.

Long:
I am new to git and egit. I have a local repository with a project in it. There is only a master branch. I had several local changes in the project (staged and unstaged). One of them were deleted files.

I wanted to discover how to use the synchronize view with egit. I synchronized the master branch. Then I used the button with the tree icon (in the synchronize view) and selected "Git change set". Now I expanded the whole tree. The deleted files appear under the branch "<staged changes>". I double clicked one of the deleted files, expecting the compare editor to appear. Instead an error dialog was shown.

"'Initializing Compare Editor for MyClass.java' has ecountered a problem. An internal error occurred during: "Initializing Compare Editor for MyClass.java"

In the details part of the dialog: 
An internal error occurred during: "Initializing Compare Editor for Converter.java".
java.lang.NullPointerException

This dialog does not appear when I choose other tree view representations via the button. It just opens a compare editor with no file content for the local side. Maybe this should happen for the case described abhove, too.
Comment 1 boegner-online CLA 2011-07-23 19:00:01 EDT
Now I see, this issue applies to modified staged files, too. I assume it applies to all staged files.
Comment 2 Remy Suen CLA 2011-07-24 07:31:40 EDT
(In reply to comment #0)
> In the details part of the dialog: 
> An internal error occurred during: "Initializing Compare Editor for
> Converter.java".
> java.lang.NullPointerException

There should be more details in your workspace's log (workspace/.metadata/.log). Please attach it to this bug.
Comment 3 Matthias Sohn CLA 2011-11-30 15:57:54 EST
Tried this with current nightly (2011-11-30) and found that opening compare editor 
on deleted resource from synchronize view in commit mode works properly