@@ -10,39 +10,20 @@ public class DynamicRepositoryTests : TestBase
10
10
{
11
11
private string ? workDirectory ;
12
12
13
- private static void ClearReadOnly ( DirectoryInfo parentDirectory )
14
- {
15
- parentDirectory . Attributes = FileAttributes . Normal ;
16
- foreach ( var fi in parentDirectory . GetFiles ( ) )
17
- {
18
- fi . Attributes = FileAttributes . Normal ;
19
- }
20
- foreach ( var di in parentDirectory . GetDirectories ( ) )
21
- {
22
- ClearReadOnly ( di ) ;
23
- }
24
- }
25
-
26
13
[ SetUp ]
27
- public void CreateTemporaryRepository ( )
14
+ public void SetUp ( )
28
15
{
29
- // Note: we can't use guid because paths will be too long
16
+ // // Note: we can't use guid because paths will be too long
30
17
this . workDirectory = PathHelper . Combine ( Path . GetTempPath ( ) , "GV" ) ;
31
18
32
- // Clean directory upfront, some build agents are having troubles
33
- if ( Directory . Exists ( this . workDirectory ) )
19
+ if ( ! Directory . Exists ( this . workDirectory ) )
34
20
{
35
- var di = new DirectoryInfo ( this . workDirectory ) ;
36
- ClearReadOnly ( di ) ;
37
-
38
- Directory . Delete ( this . workDirectory , true ) ;
21
+ Directory . CreateDirectory ( this . workDirectory ) ;
39
22
}
40
-
41
- Directory . CreateDirectory ( this . workDirectory ) ;
42
23
}
43
24
44
25
[ TearDown ]
45
- public void Cleanup ( )
26
+ public void TearDown ( )
46
27
{
47
28
}
48
29
@@ -64,7 +45,7 @@ public void FindsVersionInDynamicRepo(string name, string url, string targetBran
64
45
TargetBranch = targetBranch ,
65
46
CommitId = commitId
66
47
} ,
67
- Settings = { NoFetch = false } ,
48
+ Settings = { NoFetch = false , NoCache = true } ,
68
49
WorkingDirectory = workingDirectory
69
50
} ;
70
51
var options = Options . Create ( gitVersionOptions ) ;
0 commit comments