diff --git a/DownloadTask.cs b/DownloadTask.cs index 994db84..dbc96e1 100644 --- a/DownloadTask.cs +++ b/DownloadTask.cs @@ -740,8 +740,13 @@ internal static string[] GetOutputPaths(IReadOnlyCollection> files private async Task DuplicateFile(string filesDir, IEnumerable outputPaths, string path) { if (!this.SupportsHardLinks) { - // if hard links aren't supported, copy the path to the first output - // path + // If hard links aren't supported, copy the path to the first output + // path. + // This is done because things reference the first output path + // assuming it will exist. A copy is made to not mess up the + // validity of the ExistingPathHashes and ExistingHashPaths + // dictionaries. The old file will be removed in the remove step if + // necessary. var firstPath = outputPaths.FirstOrDefault(); if (firstPath == null) { return;