Skip to content

UE 5.8 compatibility — working changes for ISourceControlProvider #248

Description

@CoffeeBeanInteractive

I tried compiling the plugin with Unreal Engine 5.8 and encountered several breaking changes to ISourceControlProvider.

I managed to get the plugin compiling and working in UE 5.8 with the following changes.

IsAtLatestRevision() and GetNumLocalChanges() are now final in UE 5.8, so I excluded the plugin overrides for 5.8+:

#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 && ENGINE_MINOR_VERSION < 8
    TOptional<bool> IsAtLatestRevision() const override;
    TOptional<int> GetNumLocalChanges() const override;
#endif

UE 5.8 also requires these additional ISourceControlProvider methods:

#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 8
    virtual bool GetStateBranchAtIndex(int32 BranchIndex, FString& OutBranchName) const override;
    virtual bool UsesSoftRevertOnDelete() const override;
    virtual TOptional<bool> HasChangesToSync() const override;
    virtual TOptional<bool> HasChangesToCheckIn() const override;
#endif

I implemented them as:

bool FGitSourceControlProvider::GetStateBranchAtIndex(int32 BranchIndex, FString& OutBranchName) const
{
    if (StatusBranchNamePatternsInternal.IsValidIndex(BranchIndex))
    {
        OutBranchName = StatusBranchNamePatternsInternal[BranchIndex];
        return true;
    }

    return false;
}

bool FGitSourceControlProvider::UsesSoftRevertOnDelete() const
{
    return false;
}

TOptional<bool> FGitSourceControlProvider::HasChangesToSync() const
{
    return TOptional<bool>();
}

TOptional<bool> FGitSourceControlProvider::HasChangesToCheckIn() const
{
    return TOptional<bool>();
}

After these changes the plugin compiled successfully with UE 5.8 and I tested Git LFS checkout/locking from inside the Unreal Editor successfully.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions