feature: stage/unstage hunk (#265)

This commit is contained in:
leo 2024-07-17 16:56:16 +08:00
parent b9ed0987eb
commit b7e0e38de3
No known key found for this signature in database
18 changed files with 688 additions and 120 deletions

View file

@ -14,6 +14,11 @@ namespace SourceGit.Commands
public Diff(string repo, Models.DiffOption opt, int unified)
{
_result.TextDiff = new Models.TextDiff() {
Repo = repo,
Option = opt,
};
WorkingDirectory = repo;
Context = repo;
Args = $"diff --ignore-cr-at-eol --unified={unified} {opt}";
@ -214,7 +219,7 @@ namespace SourceGit.Commands
}
}
private readonly Models.DiffResult _result = new Models.DiffResult() { TextDiff = new Models.TextDiff() };
private readonly Models.DiffResult _result = new Models.DiffResult();
private readonly List<Models.TextDiffLine> _deleted = new List<Models.TextDiffLine>();
private readonly List<Models.TextDiffLine> _added = new List<Models.TextDiffLine>();
private int _oldLine = 0;