| Summary: | [sync] Checkbox "Include local uncommitted changes..." does not work | ||
|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | Stefan Lay <stefan.lay> |
| Component: | UI | Assignee: | Project Inbox <egit.ui-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dariusz.luksza |
| Version: | 0.9.0 | ||
| Target Milestone: | 0.10.0-M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Stefan Lay
(In reply to comment #0) > In the Synchronize repository dialog there is a checkbox "Include local > uncommitted changes in comparison". It does not do what it says. It always uses > the local state of the resource. > > I checked the code in GitResourceVariantComparator.getLocal(IResource > resource): > > if resource.getProject().getName() is false I would expect that the content > from the commit is used. Instead a workspace refresh takes place and the local > state is used. From my quick tests appears that GitResourceVariantComparator.getLocal() is never used when !gsd.shouldInculdeLocal() therefore no changes are required in it implementation so that if would be able to obtain a file version from Git (another thing is that, we actually don't need there if statement). > Another issue is the following: when I open the compare editor with a double > click the left side always displays the local state. But here things are more > complicated. The method GitResourceVariantComparator.getLocal(IResource > resource) is not called here, but ModelSynchronizeParticipant.asCompareInput: Yes, GitResourceVariantComparator.getLocal() isn't called because we use ModelSynchronizeParticipant instead of simple SynchronizeParticipant. But we can "hook" here our git specific ICompareInput implementation. I've test it and in case of Workspace model we get IFile instance in GitModelSynchronizeParticipant.asCompareInput(), base on this information we can return here mentioned above git specific ICompareInput preconfigured for given file. Thanks Stefan for finding this! Now we could include Git Model and Workspace model when synchronization without local changes is launched! Change set that fix this issue is here: http://egit.eclipse.org/r/1623 Fixed with commit: 2b1814e12235a968ccfffc14231ddd491b43ecdc |