org.eclipse.jgit.lib.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.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Ref.
Location where a |
| Modifier and Type | Field and Description |
|---|---|
| public static final long | UNDEFINED_UPDATE_INDEX
Update index value when a reference doesn't have one |
| Modifier and Type | Method and Description |
|---|---|
| public Ref | Returns: the reference that actually stores the ObjectId value.Traverse target references until |
| public String | |
| public ObjectId | Returns: the value of this ref at the last time we read it. May benull to indicate a ref that does not exist yet or a
symbolic ref pointing to an unborn branch.Cached value of this ref. |
| public ObjectId | Returns: if this ref is an annotated tag the id of the commit (or tree or blob) that the annotated tag refers to;null if this ref
does not refer to an annotated tag.Cached value of |
| public Ref. | |
| public Ref | Returns: the target reference, orthis.Get the reference this reference points to, or |
| public default long | Returns: the update index (i.e. version) of this reference.Indicator of the relative order between updates of a specific reference name. |
| public boolean | |
| public boolean | Returns: true if this is a symbolic reference; false if this reference contains its own ObjectId.Test if this reference is a symbolic reference. |
| UNDEFINED_UPDATE_INDEX | back to summary |
|---|---|
| public static final long UNDEFINED_UPDATE_INDEX Update index value when a reference doesn't have one
| |
| getLeaf | back to summary |
|---|---|
| public Ref getLeaf() Traverse target references until
If
If This method is effectively return isSymbolic() ? getTarget().getLeaf() : this; | |
| getName | back to summary |
|---|---|
| public String getName() What this ref is called within the repository. | |
| getObjectId | back to summary |
|---|---|
| public ObjectId getObjectId() Cached value of this ref. | |
| getPeeledObjectId | back to summary |
|---|---|
| public ObjectId getPeeledObjectId() Cached value of | |
| getStorage | back to summary |
|---|---|
| public Ref. How was this ref obtained? The current storage model of a Ref may influence how the ref must be updated or deleted from the repository. | |
| getTarget | back to summary |
|---|---|
| public Ref getTarget() Get the reference this reference points to, or
If
If this is a leaf level reference that contains its own ObjectId,this
method returns | |
| getUpdateIndex | back to summary |
|---|---|
| public default long getUpdateIndex() Indicator of the relative order between updates of a specific reference name. A number that increases when a reference is updated. With symbolic references, the update index refers to updates of the symbolic reference itself. For example, if HEAD points to refs/heads/master, then the update index for exactRef("HEAD") will only increase when HEAD changes to point to another ref, regardless of how many times refs/heads/master is updated.
Should not be used unless the
| |
| isPeeled | back to summary |
|---|---|
| public boolean isPeeled() Whether the Ref represents a peeled tag.
| |
| isSymbolic | back to summary |
|---|---|
| public boolean isSymbolic() Test if this reference is a symbolic reference.
A symbolic reference does not have its own
| |
Ref is stored.
| Modifier and Type | Field and Description |
|---|---|
| public static final Ref. | LOOSE
The ref is stored in a file by itself. |
| private final boolean | |
| public static final Ref. | |
| public static final Ref. | NETWORK
The ref came from a network advertisement and storage is unknown. |
| public static final Ref. | NEW
The ref does not exist yet, updating it may create it. |
| public static final Ref. | PACKED
The ref is stored in the |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | Returns: true if this storage is inside the packed file.Whether this storage is inside the packed file |
| public static Ref. | |
| public static Ref. |
| LOOSE | back to summary |
|---|---|
| public static final Ref. The ref is stored in a file by itself. Updating this ref affects only this ref. | |
| loose | back to summary |
|---|---|
| private final boolean loose | |
| LOOSE_PACKED | back to summary |
|---|---|
| public static final Ref. The ref is both Updating this ref requires only updating the loose file, but deletion requires updating both the loose file and the packed refs file. | |
| NETWORK | back to summary |
|---|---|
| public static final Ref. The ref came from a network advertisement and storage is unknown. This ref cannot be updated without Git-aware support on the remote side, as Git-aware code consolidate the remote refs and reported them to this process. | |
| NEW | back to summary |
|---|---|
| public static final Ref. The ref does not exist yet, updating it may create it.
Creation is likely to choose | |
| PACKED | back to summary |
|---|---|
| public static final Ref. The ref is stored in the Updating this ref requires rewriting the file, with perhaps many other refs being included at the same time. | |
| packed | back to summary |
|---|---|
| private final boolean packed | |
| Storage | back to summary |
|---|---|
| private Storage(boolean l, boolean p) | |
| isLoose | back to summary |
|---|---|
| public boolean isLoose() Whether this storage has a loose file
| |
| isPacked | back to summary |
|---|---|
| public boolean isPacked() Whether this storage is inside the packed file
| |
| valueOf | back to summary |
|---|---|
| public static Ref. | |
| values | back to summary |
|---|---|
| public static Ref. | |