Git Product home page Git Product logo

Comments (2)

ghedo avatar ghedo commented on June 7, 2024

You are right. I just implement the equivalent of git_repository_set_head(), and this is what you should do to simulate git checkout some_branch now:

my $branch = Git::Raw::Branch -> lookup($repo, 'some_branch', 1);
$repo -> checkout($branch -> target, { 'checkout_strategy' => { 'safe' => 1 } });
$repo -> head($branch);

(I just tried and it seems to work)

Note that I also took the opportunity to sync the checkout strategies in Git::Raw with the new ones in libgit2, so "update_unmodified", "update_missing", "update_modified" and "update_untracked" were removed (but you can now use the "safe" strategy, which is what git checkout does).

Also note that, as of now, the checkout implementation in Git::Raw is quite incomplete (e.g. there's no support for resolving conflicts), so only simple use cases are currently possible.

from p5-git-raw.

thaljef avatar thaljef commented on June 7, 2024

That seems to have done the trick. Ship it!

By the way, yours is the first XS code I've actually been able to understand. Well done! 👍

from p5-git-raw.

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.