Selecting a commit including the rename of a path from ~300 chars to ~220 makes the SourceTree GUI crash.
My setup:
- create a new git repo on linux/macosx
- create a file with a relative path (to the git root) longer than 260 chars
- commit and push to remote (if any)
- on Windows clone the previous project (and you will get an error with source tree)
- on linux rename the path to a shorter one and commit+push
- on windows you can clone now but if you click on the commit, SourceTree crashes
Maybe you could use another API call with the path format that can handle 32k chars:
e.g. \\?\d:\myLongPath...
2015-05-29T09:34:27: Fatal error:
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
2015-05-29T09:34:27: Stack trace:
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at SourceTree.Controls.PathTrimmingTextBlock.TextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\projects\atlassian.com\dev\bitbucket.org\sourcetreewin\Controls\PathTrimmingTextBlock.cs:line 75
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.Controls.TextBlock.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.Documents.TextElementCollection`1.get_TextContainer()
at System.Windows.Documents.TextElementCollection`1.get_FirstChild()
at System.Windows.Documents.TextElementCollection`1.get_Count()
at SourceTree.Controls.PathTrimmingTextBlock.TextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\projects\atlassian.com\dev\bitbucket.org\sourcetreewin\Controls\PathTrimmingTextBlock.cs:line 68
at SourceTree.Controls.PathTrimmingTextBlock.OnSizeChanged(Object sender, SizeChangedEventArgs sizeChangedEventArgs) in c:\projects\atlassian.com\dev\bitbucket.org\sourcetreewin\Controls\PathTrimmingTextBlock.cs:line 44
at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.FrameworkElement.OnRenderSizeChanged(SizeChangedInfo sizeInfo)
at System.Windows.ContextLayoutManager.fireSizeChangedEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)