refactor: rewrite amend behaviour (#300)

* toggle amend will show changes in HEAD commit
* since discard is not compatible with staged changes in `amend` mode, we only allows user to discard unstaged changes
This commit is contained in:
leo 2024-07-31 12:04:29 +08:00
parent 3c5a661fa0
commit f55a576013
No known key found for this signature in database
9 changed files with 261 additions and 86 deletions

View file

@ -39,7 +39,11 @@ namespace SourceGit.Models
}
else
{
_extra = "--cached";
if (change.DataForAmend != null)
_extra = "--cached HEAD^";
else
_extra = "--cached";
_path = change.Path;
_orgPath = change.OriginalPath;
}