1- using System . IO ;
1+ using Avalonia . Threading ;
2+ using System . IO ;
23
34namespace SourceGit . Commands {
45 public static class MergeTool {
56 public static bool OpenForMerge ( string repo , string tool , string mergeCmd , string file ) {
67 if ( string . IsNullOrWhiteSpace ( tool ) || string . IsNullOrWhiteSpace ( mergeCmd ) ) {
7- App . RaiseException ( repo , "Invalid external merge tool settings!" ) ;
8+ Dispatcher . UIThread . Invoke ( ( ) => {
9+ App . RaiseException ( repo , "Invalid external merge tool settings!" ) ;
10+ } ) ;
811 return false ;
912 }
1013
1114 if ( ! File . Exists ( tool ) ) {
12- App . RaiseException ( repo , $ "Can NOT found external merge tool in '{ tool } '!") ;
15+ Dispatcher . UIThread . Invoke ( ( ) => {
16+ App . RaiseException ( repo , $ "Can NOT found external merge tool in '{ tool } '!") ;
17+ } ) ;
1318 return false ;
1419 }
1520
@@ -22,12 +27,16 @@ public static bool OpenForMerge(string repo, string tool, string mergeCmd, strin
2227
2328 public static bool OpenForDiff ( string repo , string tool , string diffCmd , Models . DiffOption option ) {
2429 if ( string . IsNullOrWhiteSpace ( tool ) || string . IsNullOrWhiteSpace ( diffCmd ) ) {
25- App . RaiseException ( repo , "Invalid external merge tool settings!" ) ;
30+ Dispatcher . UIThread . Invoke ( ( ) => {
31+ App . RaiseException ( repo , "Invalid external merge tool settings!" ) ;
32+ } ) ;
2633 return false ;
2734 }
2835
2936 if ( ! File . Exists ( tool ) ) {
30- App . RaiseException ( repo , $ "Can NOT found external merge tool in '{ tool } '!") ;
37+ Dispatcher . UIThread . Invoke ( ( ) => {
38+ App . RaiseException ( repo , $ "Can NOT found external merge tool in '{ tool } '!") ;
39+ } ) ;
3140 return false ;
3241 }
3342
0 commit comments