text: 
  #include <php.h>
  #include <git2.h>
  
  #include "php_git2_internal.h"
  
  PHP_FUNCTION(git_remote_get_refspec)
  {
      zend_result zendParse;
      zval *zremote;
      zend_class_entry *ceRemote;
      zend_long n;
      struct php_git2_remote *remote;
      const git_refspec *refspec;
      zend_object *zendObj;
  
      ceRemote = php_git2_get_remote_ce();
      zendParse = zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", \
              &zremote, ceRemote, &n);
      if (zendParse != SUCCESS)
          RETURN_THROWS();
      remote = gitrem_fetch_object(Z_OBJ_P(zremote));
      refspec = git_remote_get_refspec(remote->s, n);
      if (refspec == NULL)
          RETURN_NULL();
      zendObj = gitspe_new((git_refspec *)refspec);
      RETURN_OBJ(zendObj);
  }
  
  