@@ -250,23 +250,27 @@ func TestRefSelections(t *testing.T) {
250
250
t .Run (
251
251
p .name ,
252
252
func (t * testing.T ) {
253
- if len (p .config ) != 0 {
254
- for _ , c := range p .config {
255
- cmd := testutils .GitCommand (
256
- t , path ,
257
- "config" , "--add" , fmt .Sprintf ("refgroup.mygroup.%s" , c [0 ]), c [1 ],
258
- )
259
- err := cmd .Run ()
260
- require .NoError (t , err )
261
- }
262
- defer func () {
263
- cmd := testutils .GitCommand (
264
- t , path , "config" , "--remove-section" , "refgroup.mygroup" ,
265
- )
266
- err := cmd .Run ()
267
- require .NoError (t , err )
268
- }()
253
+ clonePath , err := ioutil .TempDir ("" , "ref-selection" )
254
+ require .NoError (t , err )
255
+
256
+ defer os .RemoveAll (clonePath )
257
+
258
+ err = exec .Command (
259
+ "git" , "clone" , "--bare" , "--mirror" , path , clonePath ,
260
+ ).Run ()
261
+ require .NoError (t , err )
262
+
263
+ path := clonePath
264
+
265
+ for _ , c := range p .config {
266
+ cmd := testutils .GitCommand (
267
+ t , path ,
268
+ "config" , "--add" , fmt .Sprintf ("refgroup.mygroup.%s" , c [0 ]), c [1 ],
269
+ )
270
+ err := cmd .Run ()
271
+ require .NoError (t , err )
269
272
}
273
+
270
274
args := []string {"--show-refs" , "--no-progress" , "--json" , "--json-version=2" }
271
275
args = append (args , p .args ... )
272
276
cmd := exec .Command (executable , args ... )
0 commit comments