mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 20:04:59 +00:00
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:
parent
6620bd193e
commit
fa004ce31b
2 changed files with 5 additions and 1 deletions
|
@ -21,7 +21,7 @@ namespace SourceGit.Commands
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
Context = repo;
|
Context = repo;
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
builder.Append("restore ");
|
builder.Append("restore ");
|
||||||
if (!string.IsNullOrEmpty(extra))
|
if (!string.IsNullOrEmpty(extra))
|
||||||
builder.Append(extra).Append(" ");
|
builder.Append(extra).Append(" ");
|
||||||
|
|
|
@ -1675,7 +1675,11 @@ namespace SourceGit.ViewModels
|
||||||
var step = changes.GetRange(i, Math.Min(10, count - i));
|
var step = changes.GetRange(i, Math.Min(10, count - i));
|
||||||
var files = new List<string>();
|
var files = new List<string>();
|
||||||
foreach (var c in step)
|
foreach (var c in step)
|
||||||
|
{
|
||||||
files.Add(c.Path);
|
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());
|
await Task.Run(() => new Commands.Restore(_repo.FullPath, files, "--staged").Use(log).Exec());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue