enhance: use diff command instead of show command to get changes of selected commit. (#56)

* for merge commit, it will shows all changes compare to the first parent of the selected commit now.
This commit is contained in:
leo 2024-04-09 16:02:42 +08:00
parent 217800c83a
commit b8da3e9afd
2 changed files with 3 additions and 62 deletions

View file

@ -355,7 +355,9 @@ namespace SourceGit.ViewModels
_cancelToken.Requested = true;
_cancelToken = new Commands.Command.CancelToken();
var cmdChanges = new Commands.QueryCommitChanges(_repo, _commit.SHA) { Cancel = _cancelToken };
var parent = _commit.Parents.Count == 0 ? "4b825dc642cb6eb9a060e54bf8d69288fbee4904" : _commit.Parents[0];
var cmdChanges = new Commands.CompareRevisions(_repo, parent, _commit.SHA) { Cancel = _cancelToken };
var cmdRevisionFiles = new Commands.QueryRevisionObjects(_repo, _commit.SHA) { Cancel = _cancelToken };
Task.Run(() =>