mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Revert "Add protection against migrating to a nested folder"
This reverts commit ef8375b442
.
This commit is contained in:
parent
ef8375b442
commit
827d75b152
@ -220,30 +220,6 @@ namespace osu.Game.Tests.NonVisual
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestMigrationToNestedTargetFails()
|
|
||||||
{
|
|
||||||
using (HeadlessGameHost host = new CleanRunHeadlessGameHost(nameof(TestMigrationToSameTargetFails)))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var osu = loadOsu(host);
|
|
||||||
|
|
||||||
Assert.DoesNotThrow(() => osu.Migrate(customPath));
|
|
||||||
|
|
||||||
string subFolder = Path.Combine(customPath, "sub");
|
|
||||||
|
|
||||||
Directory.CreateDirectory(subFolder);
|
|
||||||
|
|
||||||
Assert.Throws<ArgumentException>(() => osu.Migrate(subFolder));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
host.Exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private OsuGameBase loadOsu(GameHost host)
|
private OsuGameBase loadOsu(GameHost host)
|
||||||
{
|
{
|
||||||
var osu = new OsuGameBase();
|
var osu = new OsuGameBase();
|
||||||
|
@ -48,12 +48,6 @@ namespace osu.Game.IO
|
|||||||
var source = new DirectoryInfo(GetFullPath("."));
|
var source = new DirectoryInfo(GetFullPath("."));
|
||||||
var destination = new DirectoryInfo(newLocation);
|
var destination = new DirectoryInfo(newLocation);
|
||||||
|
|
||||||
if (source.FullName == destination.FullName)
|
|
||||||
throw new ArgumentException("Destination provided is already the current location", nameof(newLocation));
|
|
||||||
|
|
||||||
if (destination.FullName.Contains(source.FullName))
|
|
||||||
throw new ArgumentException("Destination provided is inside the source", nameof(newLocation));
|
|
||||||
|
|
||||||
// ensure the new location has no files present, else hard abort
|
// ensure the new location has no files present, else hard abort
|
||||||
if (destination.Exists)
|
if (destination.Exists)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user