Sort contents before merging to unify UIDs across filesystems.

This commit is contained in:
Matthias Mailänder
2020-08-16 19:10:33 +02:00
committed by abcdefg30
parent 4d46464bc6
commit b16cbeacb6

View File

@@ -12,6 +12,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
namespace OpenRA.FileSystem namespace OpenRA.FileSystem
{ {
@@ -32,10 +33,11 @@ namespace OpenRA.FileSystem
{ {
get get
{ {
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly)) // Order may vary on different file systems and it matters for hashing.
yield return Path.GetFileName(filename); return Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly)
foreach (var filename in Directory.GetDirectories(path)) .Concat(Directory.GetDirectories(path))
yield return Path.GetFileName(filename); .Select(Path.GetFileName)
.OrderBy(f => f);
} }
} }