enhance: clear commit message before merging/cherry-picking/rebasing/reverting to allow SourceGit read it from git (#1414)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-12 10:34:22 +08:00
parent 7de5991ecb
commit 7e2f3bec8c
No known key found for this signature in database
11 changed files with 30 additions and 17 deletions

View file

@ -126,7 +126,7 @@
</ContentControl.DataTemplates>
</ContentControl>
<Button Classes="icon_button" Width="32" Command="{Binding NavigateToCurrentHead}" ToolTip.Tip="{DynamicResource Text.Repository.NavigateToCurrentHead}">
<Button Classes="icon_button" Width="32" Click="NavigateToHead" ToolTip.Tip="{DynamicResource Text.Repository.NavigateToCurrentHead}">
<Path Width="13" Height="13" Margin="0,2,0,0" Data="{StaticResource Icons.Target}" Fill="{DynamicResource Brush.FG1}"/>
</Button>
</StackPanel>

View file

@ -150,5 +150,14 @@ namespace SourceGit.Views
e.Handled = true;
}
}
private void NavigateToHead(object sender, RoutedEventArgs e)
{
if (DataContext is ViewModels.Repository { CurrentBranch: { } } repo)
{
repo.NavigateToCommit(repo.CurrentBranch.Head);
e.Handled = true;
}
}
}
}