spdr870/gitextensions — Issue #812: Exception occurs when .gitattributes contains backslashes
Author: fernsehkind
Created: 2012-02-23 20:29:38+00:00
State: open

Example for .gitattributes:
source/test/Test\ File.xls binary

If the file "source/test/Test File.xls" is selected in FileTree the following exception occurs:

System.ArgumentException: parsing "source/test/Test\" - Illegal \ at end of pattern.
at System.Text.RegularExpressions.RegexParser.ScanBackslash()
at System.Text.RegularExpressions.RegexParser.ScanRegex()
at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache)
at System.Text.RegularExpressions.Regex.IsMatch(String input, String pattern)
at GitCommands.FileHelper.IsBinaryAccordingToGitAttributes(String fileName)
at GitCommands.FileHelper.IsBinaryFile(String fileName)
at GitUI.Editor.FileViewer.ViewItem(String fileName, Func`1 getImage, Func`1 getFileText)
at GitUI.Editor.FileViewer.ViewGitItem(String fileName, String guid)
at GitUI.FormBrowse.TreeView1AfterSelect(Object sender, TreeViewEventArgs e)
at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
at System.Windows.Forms.TreeView.WmNotify(Message& m)
at System.Windows.Forms.TreeView.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)