@@ -113,7 +113,7 @@ public void TestGetDepsOneDepWithForce()
113
113
114
114
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
115
115
{
116
- { "full-build" , new DepsContent ( "new" , new List < Dep > { new Dep ( "B" ) } ) }
116
+ { "full-build" , new DepsContent ( new [ ] { "new" } , new List < Dep > { new Dep ( "B" ) } ) }
117
117
} ) ;
118
118
env . CreateRepo ( "B" , null , new [ ] { "new" } ) ;
119
119
env . Get ( "A" ) ;
@@ -122,14 +122,50 @@ public void TestGetDepsOneDepWithForce()
122
122
}
123
123
}
124
124
125
+ [ Test ]
126
+ public void TestGetDepsOneDepWithMultipleForce ( )
127
+ {
128
+ using ( var env = new TestEnvironment ( ) )
129
+ {
130
+ var dir = env . WorkingDirectory . Path ;
131
+
132
+ env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
133
+ {
134
+ { "full-build" , new DepsContent ( new [ ] { "priority" , "new" } , new List < Dep > { new Dep ( "B" ) } ) }
135
+ } ) ;
136
+ env . CreateRepo ( "B" , null , new [ ] { "new" , "priority" } ) ;
137
+ env . Get ( "A" ) ;
138
+ Assert . IsTrue ( Directory . Exists ( Path . Combine ( dir , "A" ) ) ) ;
139
+ Assert . AreEqual ( "priority" , new GitRepository ( "B" , dir , Log ) . CurrentLocalTreeish ( ) . Value ) ;
140
+ }
141
+ }
142
+
143
+ [ Test ]
144
+ public void TestGetDepsOneDepWithMultipleForceOneBranchMissing ( )
145
+ {
146
+ using ( var env = new TestEnvironment ( ) )
147
+ {
148
+ var dir = env . WorkingDirectory . Path ;
149
+
150
+ env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
151
+ {
152
+ { "full-build" , new DepsContent ( new [ ] { "missing" , "priority" , "new" } , new List < Dep > { new Dep ( "B" ) } ) }
153
+ } ) ;
154
+ env . CreateRepo ( "B" , null , new [ ] { "new" , "priority" } ) ;
155
+ env . Get ( "A" ) ;
156
+ Assert . IsTrue ( Directory . Exists ( Path . Combine ( dir , "A" ) ) ) ;
157
+ Assert . AreEqual ( "priority" , new GitRepository ( "B" , dir , Log ) . CurrentLocalTreeish ( ) . Value ) ;
158
+ }
159
+ }
160
+
125
161
[ Test ]
126
162
public void TestGetDepsOneDepWithResetThrowsDueToPolicy ( )
127
163
{
128
164
using ( var env = new TestEnvironment ( ) )
129
165
{
130
166
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
131
167
{
132
- { "full-build" , new DepsContent ( "new" , new List < Dep > { new Dep ( "B" ) } ) }
168
+ { "full-build" , new DepsContent ( new [ ] { "new" } , new List < Dep > { new Dep ( "B" ) } ) }
133
169
} ) ;
134
170
env . CreateRepo ( "B" , null , new [ ] { "new" } ) ;
135
171
env . Get ( "A" ) ;
@@ -147,7 +183,7 @@ public void TestGetDepsOneDepWithResetChanges()
147
183
148
184
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
149
185
{
150
- { "full-build" , new DepsContent ( "new" , new List < Dep > { new Dep ( "B" ) } ) }
186
+ { "full-build" , new DepsContent ( new [ ] { "new" } , new List < Dep > { new Dep ( "B" ) } ) }
151
187
} ) ;
152
188
env . CreateRepo ( "B" , null , new [ ] { "new" } ) ;
153
189
env . Get ( "A" ) ;
@@ -170,7 +206,7 @@ public void TestGetDepsOneDepWithResetChangesAndCommit()
170
206
171
207
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
172
208
{
173
- { "full-build" , new DepsContent ( "new" , new List < Dep > { new Dep ( "B" ) } ) }
209
+ { "full-build" , new DepsContent ( new [ ] { "new" } , new List < Dep > { new Dep ( "B" ) } ) }
174
210
} ) ;
175
211
env . CreateRepo ( "B" , null , new [ ] { "new" } ) ;
176
212
env . Get ( "A" ) ;
@@ -268,7 +304,7 @@ public void TestGetDepsOneDepWithCurrentBranchForceOldStyle()
268
304
269
305
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
270
306
{
271
- { "full-build" , new DepsContent ( "%CURRENT_BRANCH%" , new List < Dep > { new Dep ( "B" ) } ) }
307
+ { "full-build" , new DepsContent ( new [ ] { "%CURRENT_BRANCH%" } , new List < Dep > { new Dep ( "B" ) } ) }
272
308
} , new [ ] { "new" } , DepsFormatStyle . Ini ) ;
273
309
env . Checkout ( "A" , "new" ) ;
274
310
@@ -289,7 +325,7 @@ public void TestGetDepsOneDepWithCreatingNewRemoteBranch()
289
325
290
326
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
291
327
{
292
- { "full-build" , new DepsContent ( "%CURRENT_BRANCH%" , new List < Dep > { new Dep ( "B" ) } ) }
328
+ { "full-build" , new DepsContent ( new [ ] { "%CURRENT_BRANCH%" } , new List < Dep > { new Dep ( "B" ) } ) }
293
329
} , new [ ] { "new" } , DepsFormatStyle . Ini ) ;
294
330
env . Checkout ( "A" , "new" ) ;
295
331
@@ -313,7 +349,7 @@ public void TestGetDepsOneDepWithForceAndTreeish()
313
349
314
350
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
315
351
{
316
- { "full-build" , new DepsContent ( "new" , new List < Dep > { new Dep ( "B" ) } ) }
352
+ { "full-build" , new DepsContent ( new [ ] { "new" } , new List < Dep > { new Dep ( "B" ) } ) }
317
353
} , new [ ] { "new" } , DepsFormatStyle . Ini ) ;
318
354
319
355
env . CreateRepo ( "B" , new Dictionary < string , DepsContent >
@@ -339,7 +375,7 @@ public void TestGetDepsOneDepWithCurrentBranchForceNewStyle()
339
375
340
376
env . CreateRepo ( "A" , new Dictionary < string , DepsContent >
341
377
{
342
- { "full-build" , new DepsContent ( "$CURRENT_BRANCH" , new List < Dep > { new Dep ( "B" ) } ) }
378
+ { "full-build" , new DepsContent ( new [ ] { "$CURRENT_BRANCH" } , new List < Dep > { new Dep ( "B" ) } ) }
343
379
} , new [ ] { "new" } ) ;
344
380
env . Checkout ( "A" , "new" ) ;
345
381
@@ -680,7 +716,7 @@ public void TestGetDepsWithBranchesClientBuild()
680
716
{
681
717
{ "full-build" , new DepsContent ( null , new List < Dep > ( ) ) }
682
718
} , new [ ] { "master" , "branch1" , "branch2" } ) ;
683
-
719
+
684
720
env . Get ( "A" ) ;
685
721
Assert . IsTrue ( Directory . Exists ( Path . Combine ( dir , "C" ) ) ) ;
686
722
Assert . AreEqual ( "branch2" , new GitRepository ( "C" , dir , Log ) . CurrentLocalTreeish ( ) . Value ) ;
0 commit comments