mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
Fix sync not handling deleted lfs files correctly
This commit is contained in:
committed by
Matt Stevens
parent
cd491677a0
commit
84bc10a6c4
@@ -486,32 +486,19 @@ internal class SyncPublicRepo( string name, bool dryRun = false ) : Step( name )
|
||||
|
||||
private static HashSet<string> GetAllPublicLfsFiles( string relativeRepoPath )
|
||||
{
|
||||
// Get base set
|
||||
var trackedFiles = GetCurrentLfsFiles( relativeRepoPath );
|
||||
|
||||
// Extend with all lfs files from first commit to HEAD
|
||||
var firstCommitHash = string.Empty;
|
||||
if ( !Utility.RunProcess( "git", "rev-list --max-parents=0 HEAD", relativeRepoPath, onDataReceived: ( _, e ) =>
|
||||
if ( !Utility.RunProcess( "git", "lfs ls-files --all --deleted --name-only", relativeRepoPath, onDataReceived: ( _, e ) =>
|
||||
{
|
||||
if ( !string.IsNullOrWhiteSpace( e.Data ) )
|
||||
if ( string.IsNullOrWhiteSpace( e.Data ) )
|
||||
{
|
||||
firstCommitHash = e.Data.Trim();
|
||||
}
|
||||
} ) )
|
||||
{
|
||||
Log.Error( "Failed find first commit" );
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !Utility.RunProcess( "git", $"lfs ls-files --name-only {firstCommitHash} HEAD", relativeRepoPath, onDataReceived: ( _, e ) =>
|
||||
{
|
||||
if ( !string.IsNullOrWhiteSpace( e.Data ) )
|
||||
{
|
||||
trackedFiles.Add( ToForwardSlash( e.Data.Trim() ) );
|
||||
}
|
||||
} ) )
|
||||
{
|
||||
Log.Error( "Failed to list LFS tracked files" );
|
||||
Log.Error( "Failed to list historical LFS tracked files" );
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user