FIX: SyncDirs — preserve symlink follow/skip choice across file batches (#2887)

When TreeBuilder.BuildFromFiles() runs and the user answers 'follow all'
or 'skip all', the choice is stored in TreeBuilder.FSymLinkOption.
But after FreeAndNil(TreeBuilder) the choice was lost, so each new batch
of files started fresh with gOperationOptionSymLinks (default: ask), and
the dialog re-appeared for every symlink in every subsequent batch.

Fix: write back TreeBuilder.SymLinkOption to Self.SymLinkOption before
freeing the builder so the answer carries forward.

Co-authored-by: heredie <heredie@localhost>
(cherry picked from commit 59607049b2)
This commit is contained in:
EH 2026-05-26 02:53:55 -06:00 committed by Alexander Koblov
commit 0b98f06dd1

View file

@ -160,6 +160,7 @@ begin
TreeBuilder.ExcludeEmptyTemplateDirectories := Self.ExcludeEmptyTemplateDirectories;
TreeBuilder.BuildFromFiles(SourceFiles);
Self.SymLinkOption := TreeBuilder.SymLinkOption;
FSourceFilesTree := TreeBuilder.ReleaseTree;
FStatistics.TotalFiles := TreeBuilder.FilesCount;
FStatistics.TotalBytes := TreeBuilder.FilesSize;