mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 23:54:59 +00:00
refactor: diff for staged file with --amend
enabled (#1231)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
78f4809875
commit
345ad06aba
4 changed files with 9 additions and 3 deletions
|
@ -16,6 +16,7 @@ namespace SourceGit.Commands
|
|||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"diff-index --cached -M {parent}";
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
public List<Models.Change> Result()
|
||||
|
@ -37,6 +38,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
FileMode = match.Groups[1].Value,
|
||||
ObjectHash = match.Groups[2].Value,
|
||||
ParentSHA = _parent,
|
||||
},
|
||||
};
|
||||
change.Set(Models.ChangeState.Renamed);
|
||||
|
@ -54,6 +56,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
FileMode = match.Groups[1].Value,
|
||||
ObjectHash = match.Groups[2].Value,
|
||||
ParentSHA = _parent,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -88,5 +91,7 @@ namespace SourceGit.Commands
|
|||
|
||||
return [];
|
||||
}
|
||||
|
||||
private string _parent = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue