| Modifier and Type | Class and Description |
|---|---|
| public static enum | RefUpdate.
Status of an update request. |
| private abstract static class | RefUpdate.
Handle the abstraction of storing a ref update. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | detachingSymbolicRef
Is this RefUpdate detaching a symbolic ref? |
| private ObjectId | |
| private boolean | force
Does this specification ask for forced updated (rewind/reset)? |
| private boolean | forceRefLog
Should reflogs be written even if the configured default for this ref is not to write it. |
| private ObjectId | newValue
New value the caller wants this ref to have. |
| private ObjectId | oldValue
Old value of the ref, obtained after we lock it. |
| private PushCertificate | pushCert
Push certificate associated with this update. |
| private final Ref | |
| private PersonIdent | refLogIdent
Identity to record action as within the reflog. |
| private boolean | refLogIncludeResult
Should the Result value be appended to |
| private String | refLogMessage
Message the caller wants included in the reflog. |
| private RefUpdate. | result
Result of the update operation. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public RefUpdate. | |
| public RefUpdate. | |
| public void | |
| protected abstract RefUpdate. | Returns: resulta desiredResultorg. object.Do delete |
| protected abstract RefUpdate. | Returns: org. on success.a target)java. object.Do link |
| protected abstract RefUpdate. | Returns: resulta desiredResultorg. object.Do update |
| public RefUpdate. | |
| public ObjectId | Returns: the expected value of the ref after the lock is taken, but before update occurs. Null to avoid the compare and swap test. Useorg. to indicate
expectation of a non-existant ref.Get the expected value of the ref after the lock is taken, but before update occurs. |
| public String | |
| public ObjectId | Returns: new value. Null if the caller has not configured it.Get the new value the ref will be (or was) updated to. |
| public ObjectId | Returns: the value of the ref prior to the update being attempted; null if the updated has not been attempted yet.The old value of the ref, prior to the update being attempted. |
| protected PushCertificate | Returns: push certificate, may be null.Set the push certificate associated with this update. |
| public Ref | Returns: the reference this update will create or modify.Get the reference this update will create or modify. |
| protected abstract RefDatabase | Returns: the reference database this update modifies.Get the reference database this update modifies. |
| public PersonIdent | Returns: identity of the user making the change in the reflog.Get identity of the user making the change in the reflog. |
| public String | Returns: message the caller wants to include in the reflog; null if the update should not be logged.Get the message to include in the reflog. |
| protected abstract Repository | Returns: the repository storing the database's objects.Get the repository storing the database's objects. |
| public RefUpdate. | |
| public boolean | Returns: true if detaching a symref.Return whether this update is actually detaching a symbolic ref. |
| protected boolean | Returns: whether force writing is enabled.Check whether the reflog should be written regardless of repo defaults. |
| public boolean | Returns: true if this update should ignore merge tests.Check if this update wants to forcefully change the ref. |
| protected boolean | Returns: true if the ref log message should show the result.Whether the ref log message should show the result. |
| public RefUpdate. | Returns: org. or
org. on success.name of the new target for this reference. The new target name
must be absolute, so it must begin with target)refs/.Replace this reference with a symbolic reference to another reference. |
| private void | |
| private static RevObject | |
| private static RevObject | |
| public void | setCheckConflicting(boolean
whether to enable the check for conflicting ref names. check)Enable/disable the check for conflicting ref names. |
| public void | |
| public void | setExpectedOldObjectId(AnyObjectId
the expected value of the ref after the lock is taken, but
before update occurs. Null to avoid the compare and swap test.
Use id)org. to indicate
expectation of a non-existant ref.Set the expected value of the ref after the lock is taken, but before update occurs. |
| public void | |
| public void | setForceUpdate(boolean
true if this update should ignore merge tests. b)Set if this update wants to forcefully change the ref. |
| public void | |
| protected void | |
| public void | setPushCertificate(PushCertificate
push certificate, may be null. cert)Set a push certificate associated with this update. |
| public void | setRefLogIdent(PersonIdent
identity of the user. If null the identity will be
automatically determined based on the repository
configuration. pi)Set the identity of the user appearing in the reflog. |
| public void | setRefLogMessage(String
the message to describe this change. It may be null if
appendStatus is null in order not to append to the reflog msg, boolean true if the status of the ref change (fast-forward or
forced-update) should be appended to the user supplied
message. appendStatus)Set the message to include in the reflog. |
| protected abstract boolean | Returns: true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.true if the lock should be taken against the leaf level
reference; false if it should be taken exactly against the
current reference. deref)Try to acquire the lock on the reference. |
| protected abstract void | |
| public RefUpdate. | |
| public RefUpdate. | |
| private RefUpdate. |
| checkConflicting | back to summary |
|---|---|
| private boolean checkConflicting | |
| detachingSymbolicRef | back to summary |
|---|---|
| private boolean detachingSymbolicRef Is this RefUpdate detaching a symbolic ref? We need this info since this.ref will normally be peeled of in case of detaching a symbolic ref (HEAD for example). Without this flag we cannot decide whether the ref has to be updated or not in case when it was a symbolic ref and the newValue == oldValue. | |
| expValue | back to summary |
|---|---|
| private ObjectId expValue If non-null, the value | |
| force | back to summary |
|---|---|
| private boolean force Does this specification ask for forced updated (rewind/reset)? | |
| forceRefLog | back to summary |
|---|---|
| private boolean forceRefLog Should reflogs be written even if the configured default for this ref is not to write it. | |
| newValue | back to summary |
|---|---|
| private ObjectId newValue New value the caller wants this ref to have. | |
| oldValue | back to summary |
|---|---|
| private ObjectId oldValue Old value of the ref, obtained after we lock it. | |
| pushCert | back to summary |
|---|---|
| private PushCertificate pushCert Push certificate associated with this update. | |
| ref | back to summary |
|---|---|
| private final Ref ref | |
| refLogIdent | back to summary |
|---|---|
| private PersonIdent refLogIdent Identity to record action as within the reflog. | |
| refLogIncludeResult | back to summary |
|---|---|
| private boolean refLogIncludeResult Should the Result value be appended to | |
| refLogMessage | back to summary |
|---|---|
| private String refLogMessage Message the caller wants included in the reflog. | |
| result | back to summary |
|---|---|
| private RefUpdate. Result of the update operation. | |
| RefUpdate | back to summary |
|---|---|
| protected RefUpdate(Ref ref) Construct a new update operation for the reference.
| |
| delete | back to summary |
|---|---|
| public RefUpdate. Delete the ref. This is the same as: return delete(new RevWalk(getRepository()));
| |
| delete | back to summary |
|---|---|
| public RefUpdate. Delete the ref.
| |
| disableRefLog | back to summary |
|---|---|
| public void disableRefLog() Don't record this update in the ref's associated reflog. | |
| doDelete | back to summary |
|---|---|
| protected abstract RefUpdate. Do delete
| |
| doLink | back to summary |
|---|---|
| protected abstract RefUpdate. Do link
| |
| doUpdate | back to summary |
|---|---|
| protected abstract RefUpdate. Do update
| |
| forceUpdate | back to summary |
|---|---|
| public RefUpdate. Force the ref to take the new value. This is just a convenient helper for setting the force flag, and as such the merge test is performed.
| |
| getExpectedOldObjectId | back to summary |
|---|---|
| public ObjectId getExpectedOldObjectId() Get the expected value of the ref after the lock is taken, but before update occurs.
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name of the ref this update will operate on.
| |
| getNewObjectId | back to summary |
|---|---|
| public ObjectId getNewObjectId() Get the new value the ref will be (or was) updated to.
| |
| getOldObjectId | back to summary |
|---|---|
| public ObjectId getOldObjectId() The old value of the ref, prior to the update being attempted. This value may differ before and after the update method. Initially it is populated with the value of the ref before the lock is taken, but the old value may change if someone else modified the ref between the time we last read it and when the ref was locked for update.
| |
| getPushCertificate | back to summary |
|---|---|
| protected PushCertificate getPushCertificate() Set the push certificate associated with this update. This usually includes a command to update this ref, but is not required to.
| |
| getRef | back to summary |
|---|---|
| public Ref getRef() Get the reference this update will create or modify.
| |
| getRefDatabase | back to summary |
|---|---|
| protected abstract RefDatabase getRefDatabase() Get the reference database this update modifies.
| |
| getRefLogIdent | back to summary |
|---|---|
| public PersonIdent getRefLogIdent() Get identity of the user making the change in the reflog.
| |
| getRefLogMessage | back to summary |
|---|---|
| public String getRefLogMessage() Get the message to include in the reflog.
| |
| getRepository | back to summary |
|---|---|
| protected abstract Repository getRepository() Get the repository storing the database's objects.
| |
| getResult | back to summary |
|---|---|
| public RefUpdate. Get the status of this update. The same value that was previously returned from an update method. | |
| isDetachingSymbolicRef | back to summary |
|---|---|
| public boolean isDetachingSymbolicRef() Return whether this update is actually detaching a symbolic ref.
| |
| isForceRefLog | back to summary |
|---|---|
| protected boolean isForceRefLog() Check whether the reflog should be written regardless of repo defaults.
| |
| isForceUpdate | back to summary |
|---|---|
| public boolean isForceUpdate() Check if this update wants to forcefully change the ref.
| |
| isRefLogIncludingResult | back to summary |
|---|---|
| protected boolean isRefLogIncludingResult() Whether the ref log message should show the result.
| |
| link | back to summary |
|---|---|
| public RefUpdate. Replace this reference with a symbolic reference to another reference. This exact reference (not its traversed leaf) is replaced with a symbolic reference to the requested name.
| |
| requireCanDoUpdate | back to summary |
|---|---|
| private void requireCanDoUpdate() | |
| safeParseNew | back to summary |
|---|---|
| private static RevObject safeParseNew(RevWalk rw, AnyObjectId newId) throws IOException | |
| safeParseOld | back to summary |
|---|---|
| private static RevObject safeParseOld(RevWalk rw, AnyObjectId oldId) throws IOException | |
| setCheckConflicting | back to summary |
|---|---|
| public void setCheckConflicting(boolean check) Enable/disable the check for conflicting ref names. By default conflicts are checked explicitly.
| |
| setDetachingSymbolicRef | back to summary |
|---|---|
| public void setDetachingSymbolicRef() Tells this RefUpdate that it is actually detaching a symbolic ref. | |
| setExpectedOldObjectId | back to summary |
|---|---|
| public void setExpectedOldObjectId(AnyObjectId id) Set the expected value of the ref after the lock is taken, but before update occurs.
| |
| setForceRefLog | back to summary |
|---|---|
| public void setForceRefLog(boolean force) Force writing a reflog for the updated ref.
| |
| setForceUpdate | back to summary |
|---|---|
| public void setForceUpdate(boolean b) Set if this update wants to forcefully change the ref.
| |
| setNewObjectId | back to summary |
|---|---|
| public void setNewObjectId(AnyObjectId id) Set the new value the ref will update to.
| |
| setOldObjectId | back to summary |
|---|---|
| protected void setOldObjectId(ObjectId old) Set the old value of the ref.
| |
| setPushCertificate | back to summary |
|---|---|
| public void setPushCertificate(PushCertificate cert) Set a push certificate associated with this update. This usually includes a command to update this ref, but is not required to.
| |
| setRefLogIdent | back to summary |
|---|---|
| public void setRefLogIdent(PersonIdent pi) Set the identity of the user appearing in the reflog. The timestamp portion of the identity is ignored. A new identity with the current timestamp will be created automatically when the update occurs and the log record is written.
| |
| setRefLogMessage | back to summary |
|---|---|
| public void setRefLogMessage(String msg, boolean appendStatus) Set the message to include in the reflog.
Repository implementations may limit which reflogs are written by default,
based on the project configuration. If a repo is not configured to write
logs for this ref by default, setting the message alone may have no effect.
To indicate that the repo should write logs for this update in spite of
configured defaults, use
| |
| tryLock | back to summary |
|---|---|
| protected abstract boolean tryLock(boolean deref) throws IOException Try to acquire the lock on the reference.
If the locking was successful the implementor must set the current
identity value by calling
| |
| unlock | back to summary |
|---|---|
| protected abstract void unlock() Releases the lock taken by | |
| update | back to summary |
|---|---|
| public RefUpdate. Gracefully update the ref to the new value.
Merge test will be performed according to This is the same as: return update(new RevWalk(getRepository()));
| |
| update | back to summary |
|---|---|
| public RefUpdate. Gracefully update the ref to the new value.
Merge test will be performed according to
| |
| updateImpl | back to summary |
|---|---|
| private RefUpdate. | |
New values may be added to this enum in the future. Callers may assume that
unknown values are failures, and may generally treat them the same as
REJECTED_OTHER_REASON.
| Modifier and Type | Field and Description |
|---|---|
| public static final RefUpdate. | FAST_FORWARD
The ref was updated/deleted in a fast-forward way. |
| public static final RefUpdate. | FORCED
The ref had to be forcefully updated/deleted. |
| public static final RefUpdate. | IO_FAILURE
The ref was probably not updated/deleted because of I/O error. |
| public static final RefUpdate. | LOCK_FAILURE
The ref could not be locked for update/delete. |
| public static final RefUpdate. | NEW
The ref was created locally for an update, but ignored for delete. |
| public static final RefUpdate. | NO_CHANGE
Same value already stored. |
| public static final RefUpdate. | NOT_ATTEMPTED
The ref update/delete has not been attempted by the caller. |
| public static final RefUpdate. | REJECTED
Not a fast-forward and not stored. |
| public static final RefUpdate. | REJECTED_CURRENT_BRANCH
Rejected because trying to delete the current branch. |
| public static final RefUpdate. | REJECTED_MISSING_OBJECT
One or more objects aren't in the repository. |
| public static final RefUpdate. | REJECTED_OTHER_REASON
Rejected for some other reason not covered by another enum value. |
| public static final RefUpdate. | RENAMED
The ref was renamed from another name |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static RefUpdate. | |
| public static RefUpdate. |
| FAST_FORWARD | back to summary |
|---|---|
| public static final RefUpdate. The ref was updated/deleted in a fast-forward way. The tracking ref already existed and its old value was fully merged into the new value. No history was made unreachable. | |
| FORCED | back to summary |
|---|---|
| public static final RefUpdate. The ref had to be forcefully updated/deleted. The ref already existed but its old value was not fully merged into the new value. The configuration permitted a forced update to take place, so ref now contains the new value. History associated with the objects not merged may no longer be reachable. | |
| IO_FAILURE | back to summary |
|---|---|
| public static final RefUpdate. The ref was probably not updated/deleted because of I/O error. Unexpected I/O error occurred when writing new ref. Such error may result in uncertain state, but most probably ref was not updated.
This kind of error doesn't include | |
| LOCK_FAILURE | back to summary |
|---|---|
| public static final RefUpdate. The ref could not be locked for update/delete. This is generally a transient failure and is usually caused by another process trying to access the ref at the same time as this process was trying to update it. It is possible a future operation will be successful. | |
| NEW | back to summary |
|---|---|
| public static final RefUpdate. The ref was created locally for an update, but ignored for delete. The ref did not exist when the update started, but it was created successfully with the new value. | |
| NO_CHANGE | back to summary |
|---|---|
| public static final RefUpdate. Same value already stored. Both the old value and the new value are identical. No change was necessary for an update. For delete the branch is removed. | |
| NOT_ATTEMPTED | back to summary |
|---|---|
| public static final RefUpdate. The ref update/delete has not been attempted by the caller. | |
| REJECTED | back to summary |
|---|---|
| public static final RefUpdate. Not a fast-forward and not stored. The tracking ref already existed but its old value was not fully merged into the new value. The configuration did not allow a forced update/delete to take place, so ref still contains the old value. No previous history was lost. Note Despite the general name, this result only refers to the
non-fast-forward case. For more general errors, see | |
| REJECTED_CURRENT_BRANCH | back to summary |
|---|---|
| public static final RefUpdate. Rejected because trying to delete the current branch. Has no meaning for update. | |
| REJECTED_MISSING_OBJECT | back to summary |
|---|---|
| public static final RefUpdate. One or more objects aren't in the repository. This is severe indication of either repository corruption on the server side, or a bug in the client wherein the client did not supply all required objects during the pack transfer.
| |
| REJECTED_OTHER_REASON | back to summary |
|---|---|
| public static final RefUpdate. Rejected for some other reason not covered by another enum value.
| |
| RENAMED | back to summary |
|---|---|
| public static final RefUpdate. The ref was renamed from another name | |
| Result | back to summary |
|---|---|
| private Result() | |
| valueOf | back to summary |
|---|---|
| public static RefUpdate. | |
| values | back to summary |
|---|---|
| public static RefUpdate. | |
| Access | Constructor and Description |
|---|---|
| private |
| Store | back to summary |
|---|---|
| private Store() | |
| execute | back to summary |
|---|---|
| pack-priv abstract RefUpdate. | |