Skip to content

Commit

Permalink
Merge pull request #98 from MekuCube/RevertStatusNotUpdated
Browse files Browse the repository at this point in the history
Fixed a bug where "Mark for Add" files did not have their status updated after a full revert.
  • Loading branch information
SRombauts committed May 2, 2019
2 parents d50dc4e + 671286c commit 3d7f3ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Source/GitSourceControl/Private/GitSourceControlOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,18 @@ bool FGitRevertWorker::Execute(FGitSourceControlCommand& InCommand)
}
}

// If no files were specified (full revert), refresh all relevant files instead of the specified files (which is an empty list in full revert)
// This is required so that files that were "Marked for add" have their status updated after a full revert.
TArray<FString> FilesToUpdate = InCommand.Files;
if (InCommand.Files.Num() <= 0)
{
for (const auto& File : MissingFiles) FilesToUpdate.Add(File);
for (const auto& File : AllExistingFiles) FilesToUpdate.Add(File);
for (const auto& File : OtherThanAddedExistingFiles) FilesToUpdate.Add(File);
}

// now update the status of our files
GitSourceControlUtils::RunUpdateStatus(InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, InCommand.bUsingGitLfsLocking, InCommand.Files, InCommand.ErrorMessages, States);
GitSourceControlUtils::RunUpdateStatus(InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, InCommand.bUsingGitLfsLocking, FilesToUpdate, InCommand.ErrorMessages, States);

return InCommand.bCommandSuccessful;
}
Expand Down

0 comments on commit 3d7f3ad

Please sign in to comment.