feature<TextDiffView>: supports line staging/unstaging in working copy diff view

This commit is contained in:
leo 2024-02-27 21:13:52 +08:00
parent 91ef4e44a4
commit 671e46f8b3
10 changed files with 443 additions and 46 deletions

View file

@ -54,7 +54,7 @@ namespace SourceGit.ViewModels {
ProgressDescription = "Apply patch...";
return Task.Run(() => {
var succ = new Commands.Apply(_repo.FullPath, _patchFile, _ignoreWhiteSpace, SelectedWhiteSpaceMode.Arg).Exec();
var succ = new Commands.Apply(_repo.FullPath, _patchFile, _ignoreWhiteSpace, SelectedWhiteSpaceMode.Arg, null).Exec();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});

View file

@ -5,6 +5,18 @@ using System.Threading.Tasks;
namespace SourceGit.ViewModels {
public class DiffContext : ObservableObject {
public string RepositoryPath {
get => _repo;
}
public Models.Change WorkingCopyChange {
get => _option.WorkingCopyChange;
}
public bool IsUnstaged {
get => _option.IsUnstaged;
}
public string FilePath {
get => _option.Path;
}