Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » jgit Ref for a relative references(How do I get a jgit Ref for a relative reference name)
jgit Ref for a relative references [message #1318355] Sun, 27 April 2014 16:17 Go to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
I recently noticed that the method getRef(String name) in the class org.eclipse.jgit.lib.Repository does not handle names like "HEAD^" or "master~2".

I know JGit can handle these in general, since I use references like this in EGit, for example in the Reset dialog.

Should I be using some JGIt call other than Repository#getRef() ?



Re: jgit Ref for a relative references [message #1318673 is a reply to message #1318355] Sun, 27 April 2014 20:30 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
R Shapiro skrev 2014-04-27 18.17:
> I recently noticed that the method getRef(String name) in the class org.eclipse.jgit.lib.Repository does not handle names like "HEAD^" or "master~2".
> I know JGit can handle these in general, since I use references like this in EGit, for example in the Reset dialog.
>
> Should I be using some JGIt call other than Repository#getRef() ?

HEAD^ is not a ref. Use Repository.resolve(String) to evaluate such expressions.

-- robin
Previous Topic:Merge deleting folders and files
Next Topic:JGit/Ant integration
Goto Forum:
  


Current Time: Fri Apr 26 07:20:29 GMT 2024

Powered by FUDForum. Page generated in 0.03267 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top