Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328489 - AdaptableFileTreeIterator does not work for nested projects
Summary: AdaptableFileTreeIterator does not work for nested projects
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-22 11:33 EDT by Jens Baumgart CLA
Modified: 2010-11-12 10:14 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Baumgart CLA 2010-10-22 11:33:58 EDT
Problem 1
=========

Project A with location a
Project B with location a/b

Project A is closed

AdaptableFileTreeIterator gets 2 containers in this case and might choose the wrong one (the closed project)

final IContainer[] containers = root
	.findContainersForLocationURI(currentFile.toURI());
if (containers.length > 0)
	return new ContainerTreeIterator(this, containers[0]);

In this case Team->commit shows a big list of files with state unknown because the IndexDiff TreeWalk encounters entries with workdir iterator null because the underlying resource does not exist.

Problem 2
=========

If both projects A and B are open we have to consider which container is chosen.
If A is shared with Git and B not, A should be chosen.
If both A and B are shared with Git it happens that the same file appears twice in the commit dialog.
Comment 1 Jens Baumgart CLA 2010-10-27 08:24:36 EDT
@Problem 2: I think the innermost project should be chosen if >2 resources point on the same file because the outer project is usually created to access files above the inner project but not to access files in the inner project itself.
Which project is chosen is e.g. relevant for ignore support: a resource pointing to file f in the outer project might be ignored (derived) while another resource in the inner project also pointing to f is not ignored.
Comment 2 Jens Baumgart CLA 2010-10-27 09:06:09 EDT
Fix proposed: http://egit.eclipse.org/r/#change,1808

The duplicated entries in the commit dialog require an additional change.
Comment 3 Stefan Lay CLA 2010-11-12 10:14:04 EST
Fixed with 9e84903e1536ba05c91f6f3587cb7aefc6c0999a