@@ -978,6 +978,17 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
978
978
e . Handled = true ;
979
979
} ;
980
980
981
+ var blame = new MenuItem ( ) ;
982
+ blame . Header = App . Text ( "Blame" ) ;
983
+ blame . Icon = App . CreateMenuIcon ( "Icons.Blame" ) ;
984
+ blame . IsEnabled = change . Index != Models . ChangeState . Deleted ;
985
+ blame . Click += async ( _ , ev ) =>
986
+ {
987
+ var commit = await new Commands . QuerySingleCommit ( _repo . FullPath , "HEAD" ) . GetResultAsync ( ) ;
988
+ App . ShowWindow ( new Blame ( _repo . FullPath , change . Path , commit ) ) ;
989
+ ev . Handled = true ;
990
+ } ;
991
+
981
992
var copy = new MenuItem ( ) ;
982
993
copy . Header = App . Text ( "CopyPath" ) ;
983
994
copy . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
@@ -997,6 +1008,10 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
997
1008
} ;
998
1009
999
1010
menu . Items . Add ( history ) ;
1011
+ if ( hasSelectedFolder == false )
1012
+ {
1013
+ menu . Items . Add ( blame ) ;
1014
+ }
1000
1015
menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1001
1016
menu . Items . Add ( copy ) ;
1002
1017
menu . Items . Add ( copyFullPath ) ;
@@ -1442,6 +1457,17 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1442
1457
e . Handled = true ;
1443
1458
} ;
1444
1459
1460
+ var blame = new MenuItem ( ) ;
1461
+ blame . Header = App . Text ( "Blame" ) ;
1462
+ blame . Icon = App . CreateMenuIcon ( "Icons.Blame" ) ;
1463
+ blame . IsEnabled = change . Index != Models . ChangeState . Deleted ;
1464
+ blame . Click += async ( _ , ev ) =>
1465
+ {
1466
+ var commit = await new Commands . QuerySingleCommit ( _repo . FullPath , "HEAD" ) . GetResultAsync ( ) ;
1467
+ App . ShowWindow ( new Blame ( _repo . FullPath , change . Path , commit ) ) ;
1468
+ ev . Handled = true ;
1469
+ } ;
1470
+
1445
1471
var copyPath = new MenuItem ( ) ;
1446
1472
copyPath . Header = App . Text ( "CopyPath" ) ;
1447
1473
copyPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
@@ -1462,6 +1488,10 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1462
1488
} ;
1463
1489
1464
1490
menu . Items . Add ( history ) ;
1491
+ if ( hasSelectedFolder == false )
1492
+ {
1493
+ menu . Items . Add ( blame ) ;
1494
+ }
1465
1495
menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1466
1496
menu . Items . Add ( copyPath ) ;
1467
1497
menu . Items . Add ( copyFullPath ) ;
0 commit comments