Skip to main content



      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 12:17 Go to next message
Eclipse UserFriend
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 16:30 Go to previous message
Eclipse UserFriend
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: Tue Jul 15 08:03:29 EDT 2025

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

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

Back to the top