Code Monkey home page Code Monkey logo

Comments (3)

asgrim avatar asgrim commented on July 20, 2024

I have made a fix for this but not made a pull request yet as I'm not sure whether force should be 1 or 0 yet. on a branch: https://github.com/Asgrim/php-git/tree/fix-git_reference_create_oid-signature-bug

Commit: Asgrim/php-git@9528478a1130b537f51f30b1ae482cecf5a39f78

from php-git.

chobie avatar chobie commented on July 20, 2024

Hi James, thank you for suggesting me.

when it specified 0, git_reference_create_oid will return some sort of error when specified reference has already registered.
otherwise, force create a reference.

so, we should change that signature like following sample.

ZEND_BEGIN_ARG_INFO_EX(arginfo_git_reference_manager_create, 0, 0, 2)
    ZEND_ARG_INFO(0, name)
    ZEND_ARG_INFO(0, oid)
    ZEND_ARG_INFO(0, force)
ZEND_END_ARG_INFO()
PHP_METHOD(git_reference_manager, create)
{
    php_git_reference_manager_t *this = (php_git_reference_manager_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
    char *name;
    int name_len = 0;
    char *oid;
    int oid_len = 0;
    git_oid id;
    int force = 0;


    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
        "ssl", &name, &name_len, &oid, &oid_len, &force) == FAILURE){
        return;
    }
    //...

anyway, i'll look for your commit and libgit2 changes when i came back home (AM8 in Japan, right now).
please send pull request me.

thanks,
Shuhei

from php-git.

asgrim avatar asgrim commented on July 20, 2024

Pull request made in #12 !

from php-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.