mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 23:54:59 +00:00
fix: no changes were displayed when try to amend a commit without parent (branch first commit) (#1231)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
87ebe3741d
commit
78f4809875
2 changed files with 6 additions and 3 deletions
|
@ -11,11 +11,11 @@ namespace SourceGit.Commands
|
|||
[GeneratedRegex(@"^:[\d]{6} ([\d]{6}) ([0-9a-f]{40}) [0-9a-f]{40} R\d{0,6}\t(.*\t.*)$")]
|
||||
private static partial Regex REG_FORMAT2();
|
||||
|
||||
public QueryStagedChangesWithAmend(string repo)
|
||||
public QueryStagedChangesWithAmend(string repo, string parent)
|
||||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = "diff-index --cached -M HEAD^";
|
||||
Args = $"diff-index --cached -M {parent}";
|
||||
}
|
||||
|
||||
public List<Models.Change> Result()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue