|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Ref
Pairing of a name and the ObjectId
it currently has.
A ref in Git is (more or less) a variable that holds a single object identifier. The object identifier can be any valid Git object (blob, tree, commit, annotated tag, ...).
The ref name has the attributes of the ref that was asked for as well as the ref it was resolved to for symbolic refs plus the object id it points to and (for tags) the peeled target object id, i.e. the tag resolved recursively until a non-tag object is referenced.
Nested Class Summary | |
---|---|
static class |
Ref.Storage
Location where a Ref is stored. |
Method Summary | |
---|---|
Ref |
getLeaf()
Traverse target references until isSymbolic() is false. |
String |
getName()
What this ref is called within the repository. |
ObjectId |
getObjectId()
Cached value of this ref. |
ObjectId |
getPeeledObjectId()
Cached value of ref^{} (the ref peeled to commit). |
Ref.Storage |
getStorage()
How was this ref obtained? |
Ref |
getTarget()
Get the reference this reference points to, or this . |
boolean |
isPeeled()
|
boolean |
isSymbolic()
Test if this reference is a symbolic reference. |
Method Detail |
---|
String getName()
boolean isSymbolic()
A symbolic reference does not have its own ObjectId
value, but
instead points to another Ref
in the same database and always
uses that other reference's value as its own.
Ref getLeaf()
isSymbolic()
is false.
If isSymbolic()
is false, returns this
.
If isSymbolic()
is true, this method recursively traverses
getTarget()
until isSymbolic()
returns false.
This method is effectively
return isSymbolic() ? getTarget().getLeaf() : this;
Ref getTarget()
this
.
If isSymbolic()
is true this method returns the reference it
directly names, which might not be the leaf reference, but could be
another symbolic reference.
If this is a leaf level reference that contains its own ObjectId,this
method returns this
.
this
.ObjectId getObjectId()
ObjectId getPeeledObjectId()
ref^{}
(the ref peeled to commit).
boolean isPeeled()
Ref.Storage getStorage()
The current storage model of a Ref may influence how the ref must be updated or deleted from the repository.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |