mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
enhance: better LFS file detect method
This commit is contained in:
parent
f08acebb5e
commit
0da30b6b89
4 changed files with 30 additions and 34 deletions
|
@ -6,7 +6,15 @@
|
|||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"check-attr -a -z \"{path}\"";
|
||||
Args = $"check-attr -z filter \"{path}\"";
|
||||
RaiseError = false;
|
||||
}
|
||||
|
||||
public IsLFSFiltered(string repo, string sha, string path)
|
||||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"check-attr --source {sha} -z filter \"{path}\"";
|
||||
RaiseError = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace SourceGit.Commands
|
|||
{
|
||||
public partial class QueryFileSize : Command
|
||||
{
|
||||
|
||||
[GeneratedRegex(@"^\d+\s+\w+\s+[0-9a-f]+\s+(\d+)\s+.*$")]
|
||||
private static partial Regex REG_FORMAT();
|
||||
|
||||
|
@ -25,9 +24,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
var match = REG_FORMAT().Match(rs.StdOut);
|
||||
if (match.Success)
|
||||
{
|
||||
return long.Parse(match.Groups[1].Value);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
public static void Run(string repo, string revision, string file, string saveTo)
|
||||
{
|
||||
var isLFSFiltered = new IsLFSFiltered(repo, file).Result();
|
||||
var isLFSFiltered = new IsLFSFiltered(repo, revision, file).Result();
|
||||
if (isLFSFiltered)
|
||||
{
|
||||
var tmpFile = saveTo + ".tmp";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue