mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
ux: re-design submodule preview in revision files
This commit is contained in:
parent
e17e4b9a53
commit
a168b05ac6
6 changed files with 38 additions and 17 deletions
|
@ -201,7 +201,34 @@ namespace SourceGit.ViewModels
|
|||
});
|
||||
break;
|
||||
case Models.ObjectType.Commit:
|
||||
ViewRevisionFileContent = new Models.RevisionSubmodule() { SHA = file.SHA };
|
||||
Task.Run(() =>
|
||||
{
|
||||
var submoduleRoot = Path.Combine(_repo, file.Path);
|
||||
var commit = new Commands.QuerySingleCommit(submoduleRoot, file.SHA).Result();
|
||||
if (commit != null)
|
||||
{
|
||||
var body = new Commands.QueryCommitFullMessage(submoduleRoot, file.SHA).Result();
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
ViewRevisionFileContent = new Models.RevisionSubmodule()
|
||||
{
|
||||
Commit = commit,
|
||||
FullMessage = body,
|
||||
};
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
ViewRevisionFileContent = new Models.RevisionSubmodule()
|
||||
{
|
||||
Commit = new Models.Commit() { SHA = file.SHA },
|
||||
FullMessage = string.Empty,
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
ViewRevisionFileContent = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue