enhance: unstaged renamed file should use git restore --staged <path> <org_path> instead of git restore --staged <path>

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-01 11:19:41 +08:00
parent 6620bd193e
commit fa004ce31b
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -1675,7 +1675,11 @@ namespace SourceGit.ViewModels
var step = changes.GetRange(i, Math.Min(10, count - i));
var files = new List<string>();
foreach (var c in step)
{
files.Add(c.Path);
if (c.Index == Models.ChangeState.Renamed)
files.Add(c.OriginalPath);
}
await Task.Run(() => new Commands.Restore(_repo.FullPath, files, "--staged").Use(log).Exec());
}