Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NBug] The given path's format is not supported. #8839

Closed
yosbeleg89 opened this issue Feb 9, 2021 · 3 comments · Fixed by #8840
Closed

[NBug] The given path's format is not supported. #8839

yosbeleg89 opened this issue Feb 9, 2021 · 3 comments · Fixed by #8840

Comments

@yosbeleg89
Copy link

Current behaviour

GitExtensions crashes when right click a file with a strange path in the Diff section.

Expected behaviour

Don't crash and let make actions over that committed file.

Steps to reproduce

Right click on a file with a path like: src/my-project/c:\temp\somefile.txt in the Diff section

Error Details

System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
   at System.IO.FileInfo..ctor(String fileName)
   at GitUI.CommandsDialogs.BrowseDialog.FormBrowseUtil.FileOrParentDirectoryExists(String path)
   at GitUI.CommandsDialogs.RevisionDiffControl.UpdateStatusOfMenuItems()
   at GitUI.CommandsDialogs.RevisionDiffControl.DiffContextMenu_Opening(Object sender, CancelEventArgs e)
   at System.ComponentModel.CancelEventHandler.Invoke(Object sender, CancelEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.OnOpening(CancelEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.SetVisibleCore(Boolean visible)
   at System.Windows.Forms.ContextMenuStrip.SetVisibleCore(Boolean visible)
   at System.Windows.Forms.ToolStripDropDown.Show(Control control, Point position)
   at System.Windows.Forms.ContextMenuStrip.ShowInternal(Control source, Point location, Boolean isKeyboardActivated)
   at System.Windows.Forms.Control.WmContextMenu(Message& m, Control sourceControl)
   at System.Windows.Forms.Control.WmContextMenu(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at GitUI.UserControls.ExListView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Additional information

A file is in a branch with a path like: src/my-project/c:\temp\somefile.txt
when I right click the file in the Diff tab it crashes saying "The given path's format is not supported."

Environment

  • Git Extensions 3.4.3.9999
  • Build d4b0f48
  • Git 2.30.0.windows.2
  • Microsoft Windows NT 10.0.19042.0
  • .NET Framework 4.8.4300.0
  • DPI 120dpi (125% scaling)
@ghost ghost added the 🚧 status: in progress Issues which have associated PRs label Feb 9, 2021
@gerhardol
Copy link
Member

@yosbeleg89 Please test the portable build in the PR

@yosbeleg89
Copy link
Author

@gerhardol it does not crash anymore in the portable build, thanks.
I also tried to reset the file to First state (master) and it does nothing.

@ghost ghost removed the 🚧 status: in progress Issues which have associated PRs label Feb 10, 2021
@gerhardol
Copy link
Member

I also tried to reset the file to First state (master) and it does nothing.

Actions are disabled if there are issues like this with illegal paths, but not all actions are disabled like that. There are a lot of code for such checks already, I rather not implement a check also in this cornercase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants