Comments (2)
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.
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)
- Add support for commit trailers HOT 4
- -m32 option makes build fail on most 32 bit arches HOT 4
- please make convenience copy of libgit2 et all identifyable HOT 2
- rev-parse support is missing HOT 9
- ppport.h:4594: warning: "WIDEST_UTYPE" redefined HOT 1
- Getting a [-Wstringop-truncation] warning in Walker.xs
- Error during dzil test
- Provide Makefile.PL / cpanfile in git repo HOT 3
- API of Config->set, get to replace str, int, bool HOT 7
- Request: support enumeration and traversal of submodules HOT 6
- Refspec issue with patterns, HOT 4
- libssh2 deprecated in Redhat 7 HOT 2
- Git::Raw::Graph()->is_descendant_of doesn't propagate error codes HOT 1
- Unable to install Git::Raw on AIX 7.2 HOT 1
- Test failure with libgit2-dev 1.3.0 HOT 9
- There are various CVEs for embedded libraries HOT 5
- main vs master HOT 1
- SIGSEGV in test suite
- amending a commit
- does not compile on windows with latest strawberry perl HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5-git-raw.