Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Best way to emulate "git checkout"?

I'm working on rewriting the internals of the Hudson git plugin to use jgit rather than the git executable (as much as possible, at least), and I'm trying to figure out the best/right way to do the equivalent of "git checkout" - I've been aping the code I find in org.eclipse.jgit.pgm for clone/fetch so far, but the checkout implementation in org.eclipse.jgit.pgm.Clone.doCheckout uses a deprecated method (Repository.mapCommit) and in any case isn't quite as intuitive/obvious/simple as cloning or fetching. For that matter, I'm also not entirely sure what the right way to go from a string (i.e., a branch or SHA1) to a checkout, even with what's used in Clone. Any suggestions/pointers on what I should I look at? Thanks!

A.

Back to the top