@@ -978,6 +978,17 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
978978 e . Handled = true ;
979979 } ;
980980
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+
981992 var copy = new MenuItem ( ) ;
982993 copy . Header = App . Text ( "CopyPath" ) ;
983994 copy . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
@@ -997,6 +1008,10 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
9971008 } ;
9981009
9991010 menu . Items . Add ( history ) ;
1011+ if ( hasSelectedFolder == false )
1012+ {
1013+ menu . Items . Add ( blame ) ;
1014+ }
10001015 menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
10011016 menu . Items . Add ( copy ) ;
10021017 menu . Items . Add ( copyFullPath ) ;
@@ -1442,6 +1457,17 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
14421457 e . Handled = true ;
14431458 } ;
14441459
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+
14451471 var copyPath = new MenuItem ( ) ;
14461472 copyPath . Header = App . Text ( "CopyPath" ) ;
14471473 copyPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
@@ -1462,6 +1488,10 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
14621488 } ;
14631489
14641490 menu . Items . Add ( history ) ;
1491+ if ( hasSelectedFolder == false )
1492+ {
1493+ menu . Items . Add ( blame ) ;
1494+ }
14651495 menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
14661496 menu . Items . Add ( copyPath ) ;
14671497 menu . Items . Add ( copyFullPath ) ;
0 commit comments