From 119398139298f09ba5b61ca45c75beb6b744583b Mon Sep 17 00:00:00 2001 From: mastercoms Date: Sat, 11 Feb 2023 09:41:53 -0500 Subject: [PATCH] add a way to fallback to system LFS --- Source/GitSourceControl/Private/GitSourceControlUtils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/GitSourceControl/Private/GitSourceControlUtils.cpp b/Source/GitSourceControl/Private/GitSourceControlUtils.cpp index 49e7c2c..779c91b 100644 --- a/Source/GitSourceControl/Private/GitSourceControlUtils.cpp +++ b/Source/GitSourceControl/Private/GitSourceControlUtils.cpp @@ -653,9 +653,14 @@ bool RunCommand(const FString& InCommand, const FString& InPathToGitBinary, cons return bResult; } +#ifndef GIT_USE_CUSTOM_LFS +#define GIT_USE_CUSTOM_LFS 1 +#endif + bool RunLFSCommand(const FString& InCommand, const FString& InRepositoryRoot, const TArray& InParameters, const TArray& InFiles, TArray& OutResults, TArray& OutErrorMessages) { +#if GIT_USE_CUSTOM_LFS FString BaseDir = IPluginManager::Get().FindPlugin("GitSourceControl")->GetBaseDir(); #if PLATFORM_WINDOWS FString LFSLockBinary = FString::Printf(TEXT("%s/git-lfs.exe"), *BaseDir); @@ -672,7 +677,8 @@ bool RunLFSCommand(const FString& InCommand, const FString& InRepositoryRoot, co #elif PLATFORM_LINUX FString LFSLockBinary = FString::Printf(TEXT("%s/git-lfs"), *BaseDir); #else - checkf(false, TEXT("Unhandled platform for LFS binary!")); + ensureMsgf(false, TEXT("Unhandled platform for LFS binary!")); +#endif #endif return GitSourceControlUtils::RunCommand(InCommand, LFSLockBinary, InRepositoryRoot, InParameters, InFiles, OutResults, OutErrorMessages);