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

Bug 337042

Summary: Team->Remotes visible on all projects, even when not shared with Git
Product: [Technology] EGit Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: h1055071, jacob, mathias.kinzler
Version: 0.11   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2011-02-12 15:28:25 EST
When EGit 0.11 is installed, it adds a Team -> Remotes subcategory. However, this is visible for all projects and resources, even when the project/resource under question is not shared or not shared by a Git provider.

The actions under the Remotes are disabled, but the Remotes should not be visible unless the resource is on a project under Git control.
Comment 1 CLA 2011-02-12 17:26:53 EST
The action "Fetch from Gerrit..." is enabled under the "Remote" menu item. Unfortunately it leads to a NPE:

java.lang.NullPointerException
at org.eclipse.egit.core.RepositoryUtil.getRepositoryName(RepositoryUtil.java:239)
at org.eclipse.egit.ui.internal.fetch.FetchGerritChangePage.<init>(FetchGerritChangePage.java:108)
at org.eclipse.egit.ui.internal.fetch.FetchGerritChangeWizard.addPages(FetchGerritChangeWizard.java:38)
at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:603)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at org.eclipse.egit.ui.internal.commands.shared.FetchChangeFromGerritCommand.execute(FetchChangeFromGerritCommand.java:30)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:796)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 2 Alex Blewitt CLA 2011-02-12 19:07:01 EST
(In reply to comment #1)
> The action "Fetch from Gerrit..." is enabled under the "Remote" menu item.
> Unfortunately it leads to a NPE:

Probably a related but separate bug. Of course, if there is no EGit project then any action will fail; but if the menu isn't visible then it shouldn't be there.

Can you raise a separate bug for that? The action should only be enabled on resources whose project is under EGit anyway, in case someone has defined a global key action for it.
Comment 3 Mathias Kinzler CLA 2011-02-14 07:07:46 EST
I don't think we need a separate bug for the NPE.

*** This bug has been marked as a duplicate of bug 336716 ***
Comment 4 Mathias Kinzler CLA 2011-02-16 08:06:52 EST
*** Bug 337237 has been marked as a duplicate of this bug. ***