File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
LibGit2Sharp.Tests/TestHelpers Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,21 @@ private static void SetUpTestEnvironment()
7272SubmoduleTargetTestRepoWorkingDirPath = Path . Combine ( sourceRelativePath , "submodule_target_wd" ) ;
7373AssumeUnchangedRepoWorkingDirPath = Path . Combine ( sourceRelativePath , "assume_unchanged_wd" ) ;
7474SubmoduleSmallTestRepoWorkingDirPath = Path . Combine ( sourceRelativePath , "submodule_small_wd" ) ;
75+
76+ CleanupTestReposOlderThan ( TimeSpan . FromMinutes ( 15 ) ) ;
77+ }
78+
79+ private static void CleanupTestReposOlderThan ( TimeSpan olderThan )
80+ {
81+ var oldTestRepos = new DirectoryInfo ( Constants . TemporaryReposPath )
82+ . EnumerateDirectories ( )
83+ . Where ( di => di . CreationTimeUtc < DateTimeOffset . Now . Subtract ( olderThan ) )
84+ . Select ( di => di . FullName ) ;
85+
86+ foreach ( var dir in oldTestRepos )
87+ {
88+ DirectoryHelper . DeleteDirectory ( dir ) ;
89+ }
7590}
7691
7792private static bool IsFileSystemCaseSensitiveInternal ( )
You can’t perform that action at this time.
0 commit comments