@@ -201,7 +201,7 @@ static PHP_METHOD(Remote, download) {
201201 HashTable * refspecs = NULL ;
202202 HashTable * opts = NULL ;
203203
204- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|aa " , & refspecs , & opts ) != SUCCESS ) {
204+ if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|a!a! " , & refspecs , & opts ) != SUCCESS ) {
205205 return ;
206206 }
207207
@@ -234,19 +234,19 @@ ZEND_END_ARG_INFO()
234234static PHP_METHOD (Remote , fetch ) {
235235 HashTable * refspecs = NULL ;
236236 HashTable * opts = NULL ;
237+ git_fetch_options git_opts = GIT_FETCH_OPTIONS_INIT ;
238+ git_strarray git_refspecs ;
239+ git_refspecs .count = 0 ;
237240
238- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|aa " , & refspecs , & opts ) != SUCCESS ) {
241+ if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|a!a! " , & refspecs , & opts ) != SUCCESS ) {
239242 return ;
240243 }
241244
242245 GIT2_REMOTE_FETCH ();
243246
244- git_fetch_options git_opts = GIT_FETCH_OPTIONS_INIT ;
247+ // parse parameters
245248 git2_parse_fetch_options (& git_opts , opts );
246249
247- git_strarray git_refspecs ;
248- git_refspecs .count = 0 ;
249-
250250 if (refspecs )
251251 php_git2_ht_to_strarray (& git_refspecs , refspecs );
252252
@@ -271,7 +271,7 @@ static PHP_METHOD(Remote, upload) {
271271 HashTable * refspecs = NULL ;
272272 HashTable * opts = NULL ;
273273
274- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|aa " , & refspecs , & opts ) != SUCCESS ) {
274+ if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|a!a! " , & refspecs , & opts ) != SUCCESS ) {
275275 return ;
276276 }
277277 GIT2_REMOTE_FETCH ();
@@ -302,7 +302,7 @@ static PHP_METHOD(Remote, push) {
302302 HashTable * refspecs = NULL ;
303303 HashTable * opts = NULL ;
304304
305- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|aa " , & refspecs , & opts ) != SUCCESS ) {
305+ if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "|a!a! " , & refspecs , & opts ) != SUCCESS ) {
306306 return ;
307307 }
308308 GIT2_REMOTE_FETCH ();
0 commit comments