mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 10:25:00 +00:00
refactor: use git reset --hard HEAD
to discard all changes and use git restore --staged
to unstage changes in text diff view
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
78f9ae2fa9
commit
f1052c3efc
3 changed files with 5 additions and 29 deletions
|
@ -1928,8 +1928,10 @@ namespace SourceGit.Views
|
|||
{
|
||||
if (change.DataForAmend != null)
|
||||
new Commands.UnstageChangesForAmend(repo.FullPath, [change]).Exec();
|
||||
else if (change.Index == Models.ChangeState.Renamed)
|
||||
new Commands.Restore(repo.FullPath, [change.Path, change.OriginalPath], "--staged").Exec();
|
||||
else
|
||||
new Commands.Reset(repo.FullPath, [change]).Exec();
|
||||
new Commands.Restore(repo.FullPath, [change.Path], "--staged").Exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue