diff --git a/src/Models/RevisionFile.cs b/src/Models/RevisionFile.cs index 9dd49545..f1effc4d 100644 --- a/src/Models/RevisionFile.cs +++ b/src/Models/RevisionFile.cs @@ -1,5 +1,6 @@ namespace SourceGit.Models { public class RevisionBinaryFile { + public long Size { get; set; } = 0; } public class RevisionTextFile { diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 3c031ca8..1e189191 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -353,8 +353,9 @@ namespace SourceGit.ViewModels { Task.Run(() => { var isBinary = new Commands.IsBinary(_repo, _commit.SHA, file.Path).Result(); if (isBinary) { + var size = new Commands.QueryFileSize(_repo, file.Path, _commit.SHA).Result(); Dispatcher.UIThread.Invoke(() => { - ViewRevisionFileContent = new Models.RevisionBinaryFile(); + ViewRevisionFileContent = new Models.RevisionBinaryFile() { Size = size }; }); return; } diff --git a/src/Views/RevisionFiles.axaml b/src/Views/RevisionFiles.axaml index 064fe80a..17ed8876 100644 --- a/src/Views/RevisionFiles.axaml +++ b/src/Views/RevisionFiles.axaml @@ -81,6 +81,10 @@ + + + +