Show file size changes for binary diff

This commit is contained in:
leo 2020-07-13 16:50:15 +08:00
parent e8ef47f33d
commit e08b7024fc
9 changed files with 163 additions and 27 deletions

View file

@ -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