Skip to content

Commit

Permalink
add a way to fallback to system LFS
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Feb 11, 2023
1 parent 8e05302 commit 1193981
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/GitSourceControl/Private/GitSourceControlUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FString>& InParameters, const TArray<FString>& InFiles,
TArray<FString>& OutResults, TArray<FString>& 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);
Expand All @@ -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);
Expand Down

0 comments on commit 1193981

Please sign in to comment.