Eclipse GIT问题:无法签出分支(文件名,目录名或卷标语法不正确)

时间:2015-06-02 04:06:51

标签: eclipse egit jgit

当我尝试签出现有分支时,Git抛出异常'文件名,目录名或卷标语法不正确'。

错误日志:

org.eclipse.jgit.api.errors.JGitInternalException: The filename, directory name, or volume label syntax is incorrect
at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:294)
at org.eclipse.egit.core.op.BranchOperation$1.run(BranchOperation.java:133)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at org.eclipse.egit.core.op.BranchOperation.execute(BranchOperation.java:156)
at org.eclipse.egit.ui.internal.branch.BranchOperationUI.run(BranchOperationUI.java:258)
at org.eclipse.egit.ui.internal.repository.CreateBranchPage.createBranch(CreateBranchPage.java:475)
at org.eclipse.egit.ui.internal.repository.CreateBranchWizard$1.run(CreateBranchWizard.java:93)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1028)
at org.eclipse.egit.ui.internal.repository.CreateBranchWizard.performFinish(CreateBranchWizard.java:87)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
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:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.egit.ui.internal.branch.BranchOperationUI.getTargetWithDialog(BranchOperationUI.java:276)
at org.eclipse.egit.ui.internal.branch.BranchOperationUI.start(BranchOperationUI.java:152)
at org.eclipse.egit.ui.internal.actions.SwitchToMenu$1.widgetSelected(SwitchToMenu.java:120)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
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:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(Unknown Source)
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:968)
    at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:457)
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:391)
    at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:240)
    ... 51 more

原因: 文件夹名称中的尾随空格。

1 个答案:

答案 0 :(得分:1)

我找到了这个问题的原因。错误地,开发人员在新文件夹的名称中放置了一个尾随空格。并推动了此提交。

文件夹名称:

'myFolder '

当我尝试使用上面的提交检出任何分支时,'文件名,目录名或卷标语法不正确'会发生错误。当他重命名文件夹名称(删除尾随空格)时。他推了这个提交。现在我可以结帐这个分支。