@@ -236,6 +236,7 @@ func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackAllowedWhenWithImp
236
236
assert .NoError (suite .T (), chdir (suite .T (), suite .localRepo ), "unable to chdir into our local Git repo" )
237
237
cmd := exec .Command ("git" , "push" , "--all" , "--receive-pack=spokes-receive-pack-wrapper" , "r" )
238
238
cmd .Env = append (os .Environ (),
239
+ "GIT_SOCKSTAT_VAR_is_importing=bool:true" ,
239
240
"GIT_SOCKSTAT_VAR_import_skip_push_limit=bool:true" ,
240
241
)
241
242
err := cmd .Run ()
@@ -245,6 +246,23 @@ func (suite *SpokesReceivePackTestSuite) TestSpokesReceivePackAllowedWhenWithImp
245
246
"unexpected failure with the custom spokes-receive-pack program; it should have succeeded" )
246
247
}
247
248
249
+ func (suite * SpokesReceivePackTestSuite ) TestSpokesReceivePackAllowedWhenImporting () {
250
+ assert .NoError (suite .T (), chdir (suite .T (), suite .remoteRepo ), "unable to chdir into our remote Git repo" )
251
+ // Set a really low value to receive.maxsize in order to make it fail
252
+ require .NoError (suite .T (), exec .Command ("git" , "config" , "receive.maxsize" , "1" ).Run ())
253
+
254
+ assert .NoError (suite .T (), chdir (suite .T (), suite .localRepo ), "unable to chdir into our local Git repo" )
255
+ cmd := exec .Command ("git" , "push" , "--all" , "--receive-pack=spokes-receive-pack-wrapper" , "r" )
256
+ cmd .Env = append (os .Environ (),
257
+ "GIT_SOCKSTAT_VAR_is_importing=bool:true" ,
258
+ )
259
+ err := cmd .Run ()
260
+ assert .NoError (
261
+ suite .T (),
262
+ err ,
263
+ "unexpected failure with the custom spokes-receive-pack program; it should have succeeded" )
264
+ }
265
+
248
266
func (suite * SpokesReceivePackTestSuite ) TestWithGovernor () {
249
267
started := make (chan any )
250
268
govSock , msgs , cleanup := startFakeGovernor (suite .T (), started , nil )
0 commit comments