diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index ef060f04..7ef8ce85 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -293,7 +293,7 @@ namespace SourceGit.ViewModels history.Icon = App.CreateMenuIcon("Icons.Histories"); history.Click += (_, ev) => { - var window = new Views.FileHistories() { DataContext = new FileHistories(_repo, change.Path) }; + var window = new Views.FileHistories() { DataContext = new FileHistories(_repo, change.Path, _commit.SHA) }; window.Show(); ev.Handled = true; }; @@ -434,7 +434,7 @@ namespace SourceGit.ViewModels history.Icon = App.CreateMenuIcon("Icons.Histories"); history.Click += (_, ev) => { - var window = new Views.FileHistories() { DataContext = new FileHistories(_repo, file.Path) }; + var window = new Views.FileHistories() { DataContext = new FileHistories(_repo, file.Path, _commit.SHA) }; window.Show(); ev.Handled = true; }; diff --git a/src/ViewModels/FileHistories.cs b/src/ViewModels/FileHistories.cs index 035cadfd..52ed6b01 100644 --- a/src/ViewModels/FileHistories.cs +++ b/src/ViewModels/FileHistories.cs @@ -57,14 +57,14 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _viewContent, value); } - public FileHistories(Repository repo, string file) + public FileHistories(Repository repo, string file, string commit = null) { _repo = repo; _file = file; Task.Run(() => { - var commits = new Commands.QueryCommits(_repo.FullPath, $"-n 10000 -- \"{file}\"", false).Result(); + var commits = new Commands.QueryCommits(_repo.FullPath, $"-n 10000 {commit} -- \"{file}\"", false).Result(); Dispatcher.UIThread.Invoke(() => { IsLoading = false;