text: 
  #include <php.h>
  #include <git2.h>
  
  #include "php_git2_internal.h"
  
  PHP_FUNCTION(git_commit_lookup_prefix)
  {
      int libRet;
      zend_result zendParse;
      zval *zrepository;
      zend_class_entry *ceRepository;
      zend_string *strOid;
      struct php_git2_repository *repository;
      git_commit *commit;
      git_oid oid;
      zend_object *zendObj;
  
      libRet = 0;
      ceRepository = php_git2_get_repository_ce();
      zendParse = zend_parse_parameters(ZEND_NUM_ARGS(), "OS", \
          &zrepository, ceRepository, &strOid);
      if (zendParse != SUCCESS)
          RETURN_THROWS();
      repository = gitrep_fetch_object(Z_OBJ_P(zrepository));
      libRet = git_oid_fromstrn(&oid, ZSTR_VAL(strOid), ZSTR_LEN(strOid));
      if (libRet != GIT_OK)
          RETURN_LIBGIT2_ERROR(libRet);
      libRet = git_commit_lookup_prefix(&commit, repository->s, &oid, \
              ZSTR_LEN(strOid));
      if (libRet != GIT_OK)
          RETURN_LIBGIT2_ERROR(libRet);
      zendObj = gitcom_new(commit);
      RETURN_OBJ(zendObj);
  }
  
  