Bug 559745 - Rebase Operation deletes project from workspace
Summary: Rebase Operation deletes project from workspace
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 5.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-31 07:32 EST by Matthias Hanisch CLA
Modified: 2020-01-31 07:32 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Hanisch CLA 2020-01-31 07:32:40 EST
Steps to reproduce:

- Create a local(-only) git repository, add it to Eclipse, import it as Eclipse project and add a few commits
- Create a remote repository with the goal to push the local commits to the remote repository. The remote repository only has one commit with a README.md. It has no .project file which might be an important information for the error behavior.
- In "Git Repositories" view add the remote repo as Remote to the local repository including configuration of Fetch specs.
- Fetch the single commit from remote repo using Team/Fetch
- Rebase against the remote branch

In Eclipse the following error message is shown:
The project description file (.project) for 'myproject' is missing.  This file contains important information about the project.  The project will not function properly until this file is restored.

And the Eclipse project got removed from the workspace. Also the rebase was not completely executed.

In .metadata/.log there are the following two exceptions:

!ENTRY org.eclipse.egit.ui 4 2 2020-01-31 11:41:23.009
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.egit.ui".
!STACK 0
java.lang.NullPointerException
        at org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler.handleBeginError(AbstractRebaseCommandHandler.java:244)
        at org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler.access$0(AbstractRebaseCommandHandler.java:239)
        at org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler$1.done(AbstractRebaseCommandHandler.java:112)
        at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:80)
        at org.eclipse.core.internal.jobs.JobListeners.done(JobListeners.java:118)
        at org.eclipse.core.internal.jobs.JobManager.endJob(JobManager.java:701)
        at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:117)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:83)

!ENTRY org.eclipse.core.resources 4 271 2020-01-31 11:41:23.010
!MESSAGE Errors occurred while refreshing resources with the local file system.
!SUBENTRY 1 org.eclipse.core.resources 4 567 2020-01-31 11:41:23.010
!MESSAGE The project description file (.project) for 'myproject' is missing.  This file contains important information about the project.  The project will not function properly until this file is restored.
!STACK 0
java.lang.Exception: The project description file (.project) for 'myproject' is missing.  This file contains important information about the project.  The project will not function properly until this file is restored.
        at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
        at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
        at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
        at org.eclipse.core.internal.resources.Project.updateDescription(Project.java:1346)
        at org.eclipse.core.internal.resources.File.updateMetadataFiles(File.java:376)
        at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:291)
        at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:118)
        at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:977)
        at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:960)
        at org.eclipse.core.internal.resources.AliasManager.updateAliases(AliasManager.java:727)
        at org.eclipse.core.internal.resources.Resource.delete(Resource.java:774)
        at org.eclipse.core.internal.resources.Project.delete(Project.java:320)
        at org.eclipse.egit.core.internal.util.ProjectUtil.refreshValidProjects(ProjectUtil.java:156)
        at org.eclipse.egit.core.internal.util.ProjectUtil.refreshValidProjects(ProjectUtil.java:113)
        at org.eclipse.egit.core.op.RebaseOperation$1.run(RebaseOperation.java:161)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
        at org.eclipse.egit.core.op.RebaseOperation.execute(RebaseOperation.java:167)
        at org.eclipse.egit.core.internal.job.JobUtil$2.runInWorkspace(JobUtil.java:107)
        at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

I suspect that during rebase the ".project" file got temporarily removed (maybe because origin/master does not have a .project file) and because of that ProjectUtil.refreshValidProjects just deletes the project from workspace.