1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . IO ;
4
4
using System . Threading . Tasks ;
@@ -635,7 +635,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
635
635
}
636
636
else if ( _inProgressContext is RevertInProgress revert )
637
637
{
638
- useTheirs . Header = App . Text ( "FileCM.ResolveUsing" , revert . Head . SHA . Substring ( 0 , 10 ) + " (revert)") ;
638
+ useTheirs . Header = App . Text ( "FileCM.ResolveUsing" , $ " { revert . Head . SHA . AsSpan ( ) . Slice ( 0 , 10 ) } (revert)") ;
639
639
useMine . Header = App . Text ( "FileCM.ResolveUsing" , _repo . CurrentBranch . Name ) ;
640
640
}
641
641
else if ( _inProgressContext is MergeInProgress merge )
@@ -771,7 +771,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
771
771
byExtension . Header = App . Text ( "WorkingCopy.AddToGitIgnore.Extension" , extension ) ;
772
772
byExtension . Click += ( _ , e ) =>
773
773
{
774
- Commands . GitIgnore . Add ( _repo . FullPath , "*" + extension ) ;
774
+ Commands . GitIgnore . Add ( _repo . FullPath , $ "* { extension } " ) ;
775
775
e . Handled = true ;
776
776
} ;
777
777
addToIgnore . Items . Add ( byExtension ) ;
@@ -782,7 +782,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
782
782
byExtensionInSameFolder . Click += ( _ , e ) =>
783
783
{
784
784
var dir = Path . GetDirectoryName ( change . Path ) . Replace ( "\\ " , "/" ) ;
785
- Commands . GitIgnore . Add ( _repo . FullPath , dir + "/*" + extension ) ;
785
+ Commands . GitIgnore . Add ( _repo . FullPath , $ " { dir } /* { extension } " ) ;
786
786
e . Handled = true ;
787
787
} ;
788
788
addToIgnore . Items . Add ( byExtensionInSameFolder ) ;
@@ -824,7 +824,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
824
824
lfsTrackByExtension . Click += async ( _ , e ) =>
825
825
{
826
826
var log = _repo . CreateLog ( "Track LFS" ) ;
827
- var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Track ( "*" + extension , false , log ) ) ;
827
+ var succ = await Task . Run ( ( ) => new Commands . LFS ( _repo . FullPath ) . Track ( $ "* { extension } " , false , log ) ) ;
828
828
if ( succ )
829
829
App . SendNotification ( _repo . FullPath , $ "Tracking all *{ extension } files successfully!") ;
830
830
@@ -993,7 +993,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
993
993
}
994
994
else if ( _inProgressContext is RevertInProgress revert )
995
995
{
996
- useTheirs . Header = App . Text ( "FileCM.ResolveUsing" , revert . Head . SHA . Substring ( 0 , 10 ) + " (revert)") ;
996
+ useTheirs . Header = App . Text ( "FileCM.ResolveUsing" , $ " { revert . Head . SHA . AsSpan ( ) . Slice ( 0 , 10 ) } (revert)") ;
997
997
useMine . Header = App . Text ( "FileCM.ResolveUsing" , _repo . CurrentBranch . Name ) ;
998
998
}
999
999
else if ( _inProgressContext is MergeInProgress merge )
@@ -1417,7 +1417,7 @@ public ContextMenu CreateContextMenuForCommitMessages()
1417
1417
var home = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
1418
1418
var prefixLen = home . EndsWith ( '/' ) ? home . Length - 1 : home . Length ;
1419
1419
if ( gitTemplate . StartsWith ( home , StringComparison . Ordinal ) )
1420
- friendlyName = "~" + gitTemplate . Substring ( prefixLen ) ;
1420
+ friendlyName = $ "~ { gitTemplate . AsSpan ( ) . Slice ( prefixLen ) } " ;
1421
1421
}
1422
1422
1423
1423
var gitTemplateItem = new MenuItem ( ) ;
0 commit comments