DESCRIPTION

Delete invalid projects after work dir checkout

Operations performing a work dir checkout (e.g. branch, reset)
may delete .project files. This leads to inconsistent projects
causing follow-up problems. This fix deletes projects that got
inconsistent by the work dir checkout.

Problem example:

Project p exists in branch b1.
.project file of project p is contained in the Git repository.
Project p does not exist in branch b2.
Active branch is b1.
Checkout branch b2. This removes the .project file of p.
Branch operation fails because refreshing p fails.
The workspace now contains a project with missing .project file.

Some time later the DelayedSnapshotJob (Workspace Auto-save) restores the
.project file.

Switching back to branch b1 fails with a checkout conflict:
workdir checkout can not be done because there is an untracked .project file 
in the working directory.

Bug: 316104
Signed-off-by: Marlie Beasley xxx@xxx.xxx

COMMENTS

author: Juliet Cantu
date: 2010-06-08 19:57:24.000000000

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

Mostly ok, but the commit message should be clearer. It contains a bit too much text actually. Also meantion that
this is not a complete solution since it does not open projects that appear. This would happen due to refactoring. The actual implementation of that can be subject of another patch. In those cases the workspace would still be inconsistent, even when we have all projects.

I also think the user should be warned that closing/opening is about to happen and have the option to abort before anything happens.

We need more Unit tests. Yep, it's hard. Whether you do it using SWTBot or not is less important to me, but it's probably a bit better if you can do without.

-------------------------------------
author: Marlie Beasley
date: 2010-06-09 08:49:48.000000000

MISMATCHED INLINE COMMENT
Line:70, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> 1. refreshing projects is not required in this operation (no resources are changed).
2. ProjectUtil.refreshProjects was deleted because it was replaced by new methods.

-------------------------------------
author: Juliet Cantu
date: 2010-06-08 19:57:23.000000000

MISMATCHED INLINE COMMENT
Line:70, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> What does this have to do with the subject?

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