mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
Show file size changes for binary diff
This commit is contained in:
parent
e8ef47f33d
commit
e08b7024fc
9 changed files with 163 additions and 27 deletions
|
@ -4,6 +4,7 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Threading;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
@ -876,6 +877,20 @@ namespace SourceGit.Git {
|
|||
if (errs != null) App.RaiseError(errs);
|
||||
return blame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get file size.
|
||||
/// </summary>
|
||||
/// <param name="sha"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public long GetFileSize(string sha, string path) {
|
||||
long size = 0;
|
||||
RunCommand($"cat-file -s {sha}:\"{path}\"", line => {
|
||||
if (!long.TryParse(line, out size)) size = 0;
|
||||
});
|
||||
return size;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region METHOD_GITFLOW
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue