class RefDirectoryUpdate extends RefUpdate
RefDirectory
.RefUpdate.Result
Modifier and Type | Field and Description |
---|---|
private RefDirectory |
database |
private LockFile |
lock |
private boolean |
shouldDeref |
Constructor and Description |
---|
RefDirectoryUpdate(RefDirectory r,
Ref ref) |
Modifier and Type | Method and Description |
---|---|
protected RefUpdate.Result |
doDelete(RefUpdate.Result status)
Do delete
|
protected RefUpdate.Result |
doLink(java.lang.String target)
Do link
|
protected RefUpdate.Result |
doUpdate(RefUpdate.Result status)
Do update
|
protected RefDirectory |
getRefDatabase()
Get the reference database this update modifies.
|
protected Repository |
getRepository()
Get the repository storing the database's objects.
|
private java.lang.String |
toResultString(RefUpdate.Result status) |
protected boolean |
tryLock(boolean deref)
Try to acquire the lock on the reference.
|
protected void |
unlock()
Releases the lock taken by
RefUpdate.tryLock(boolean) if it succeeded. |
delete, delete, disableRefLog, forceUpdate, getExpectedOldObjectId, getName, getNewObjectId, getOldObjectId, getPushCertificate, getRef, getRefLogIdent, getRefLogMessage, getResult, isDetachingSymbolicRef, isForceRefLog, isForceUpdate, isRefLogIncludingResult, link, setCheckConflicting, setDetachingSymbolicRef, setExpectedOldObjectId, setForceRefLog, setForceUpdate, setNewObjectId, setOldObjectId, setPushCertificate, setRefLogIdent, setRefLogMessage, update, update
private final RefDirectory database
private boolean shouldDeref
private LockFile lock
RefDirectoryUpdate(RefDirectory r, Ref ref)
protected RefDirectory getRefDatabase()
getRefDatabase
in class RefUpdate
protected Repository getRepository()
getRepository
in class RefUpdate
protected boolean tryLock(boolean deref) throws java.io.IOException
If the locking was successful the implementor must set the current
identity value by calling RefUpdate.setOldObjectId(ObjectId)
.
tryLock
in class RefUpdate
deref
- true if the lock should be taken against the leaf level
reference; false if it should be taken exactly against the
current reference.java.io.IOException
- the lock couldn't be taken due to an unexpected storage
failure, and not because of a concurrent update.protected void unlock()
RefUpdate.tryLock(boolean)
if it succeeded.protected RefUpdate.Result doUpdate(RefUpdate.Result status) throws java.io.IOException
doUpdate
in class RefUpdate
status
- a RefUpdate.Result
object.result
java.io.IOException
private java.lang.String toResultString(RefUpdate.Result status)
protected RefUpdate.Result doDelete(RefUpdate.Result status) throws java.io.IOException
doDelete
in class RefUpdate
status
- a RefUpdate.Result
object.result
java.io.IOException
protected RefUpdate.Result doLink(java.lang.String target) throws java.io.IOException
doLink
in class RefUpdate
target
- a String
object.RefUpdate.Result.NEW
on success.java.io.IOException