@@ -27,6 +27,8 @@ static BaseFixture()
27
27
28
28
public static readonly Signature DummySignature = new Signature ( "Author N. Ame" , "him@there.com" , TruncateSubSeconds ( DateTimeOffset . Now ) ) ;
29
29
30
+ public static bool IsFileSystemCaseSensitive { get ; private set ; }
31
+
30
32
protected static DateTimeOffset TruncateSubSeconds ( DateTimeOffset dto )
31
33
{
32
34
int seconds = dto . ToSecondsSinceEpoch ( ) ;
@@ -35,6 +37,8 @@ protected static DateTimeOffset TruncateSubSeconds(DateTimeOffset dto)
35
37
36
38
private static void SetUpTestEnvironment ( )
37
39
{
40
+ IsFileSystemCaseSensitive = IsFileSystemCaseSensitiveInternal ( ) ;
41
+
38
42
var source = new DirectoryInfo ( @"../../Resources" ) ;
39
43
ResourcesDirectory = new DirectoryInfo ( string . Format ( @"Resources/{0}" , Guid . NewGuid ( ) ) ) ;
40
44
var parent = new DirectoryInfo ( @"Resources" ) ;
@@ -54,6 +58,23 @@ private static void SetUpTestEnvironment()
54
58
SubmoduleTestRepoWorkingDirPath = Path . Combine ( ResourcesDirectory . FullName , "submodule_wd" ) ;
55
59
}
56
60
61
+ private static bool IsFileSystemCaseSensitiveInternal ( )
62
+ {
63
+ var mixedPath = Path . Combine ( Constants . TemporaryReposPath , "mIxEdCase" ) ;
64
+
65
+ if ( Directory . Exists ( mixedPath ) )
66
+ {
67
+ Directory . Delete ( mixedPath ) ;
68
+ }
69
+
70
+ Directory . CreateDirectory ( mixedPath ) ;
71
+ bool isInsensitive = Directory . Exists ( mixedPath . ToLowerInvariant ( ) ) ;
72
+
73
+ Directory . Delete ( mixedPath ) ;
74
+
75
+ return ! isInsensitive ;
76
+ }
77
+
57
78
protected void CreateCorruptedDeadBeefHead ( string repoPath )
58
79
{
59
80
const string deadbeef = "deadbeef" ;
0 commit comments