feature: add context menu Save As Patch... for selected stash (#1018)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-24 21:24:53 +08:00
parent 4868ea1a0b
commit 1d037c7c57
No known key found for this signature in database
5 changed files with 53 additions and 0 deletions

View file

@ -37,6 +37,19 @@ namespace SourceGit.Commands
return true;
}
public static bool ProcessStashChanges(string repo, List<Models.DiffOption> opts, string saveTo)
{
using (var sw = File.Create(saveTo))
{
foreach (var opt in opts)
{
if (!ProcessSingleChange(repo, opt, sw))
return false;
}
}
return true;
}
private static bool ProcessSingleChange(string repo, Models.DiffOption opt, FileStream writer)
{
var starter = new ProcessStartInfo();