mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
fix: in commit view get file histories by commit (#708)
When file histories are accessed from the commit details view, run git log for the inspected commit. Previously the log was ran against current branch regardless whether the inspected commit belongs to that branch.
This commit is contained in:
parent
882878dbe5
commit
5301645f8b
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue