Class DfsRefUpdate
java.lang.Object
org.eclipse.jgit.lib.RefUpdate
org.eclipse.jgit.internal.storage.dfs.DfsRefUpdate
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.RefUpdate
RefUpdate.Result -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RefUpdate.ResultdoDelete(RefUpdate.Result desiredResult) Do deleteprotected RefUpdate.ResultDo linkprotected RefUpdate.ResultdoUpdate(RefUpdate.Result desiredResult) Do updateprotected DfsRefDatabaseGet the reference database this update modifies.protected DfsRepositoryGet the repository storing the database's objects.protected booleantryLock(boolean deref) Try to acquire the lock on the reference.protected voidunlock()Releases the lock taken byRefUpdate.tryLock(boolean)if it succeeded.Gracefully update the ref to the new value.Methods inherited from class org.eclipse.jgit.lib.RefUpdate
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
-
Field Details
-
refdb
-
dstRef
-
rw
-
-
Constructor Details
-
DfsRefUpdate
DfsRefUpdate(DfsRefDatabase refdb, Ref ref)
-
-
Method Details
-
getRefDatabase
Get the reference database this update modifies.- Specified by:
getRefDatabasein classRefUpdate- Returns:
- the reference database this update modifies.
-
getRepository
Get the repository storing the database's objects.- Specified by:
getRepositoryin classRefUpdate- Returns:
- the repository storing the database's objects.
-
tryLock
Try to acquire the lock on the reference.If the locking was successful the implementor must set the current identity value by calling
RefUpdate.setOldObjectId(ObjectId).- Specified by:
tryLockin classRefUpdate- Parameters:
deref- true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.- Returns:
- true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.
- Throws:
IOException- the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.
-
unlock
protected void unlock()Releases the lock taken byRefUpdate.tryLock(boolean)if it succeeded. -
update
Gracefully update the ref to the new value.Merge test will be performed according to
RefUpdate.isForceUpdate().- Overrides:
updatein classRefUpdate- Parameters:
walk- a RevWalk instance this update command can borrow to perform the merge test. The walk will be reset to perform the test.- Returns:
- the result status of the update.
- Throws:
IOException- an unexpected IO error occurred while writing changes.
-
doUpdate
Do update- Specified by:
doUpdatein classRefUpdate- Parameters:
desiredResult- aRefUpdate.Resultobject.- Returns:
result- Throws:
IOException
-
doDelete
Do delete- Specified by:
doDeletein classRefUpdate- Parameters:
desiredResult- aRefUpdate.Resultobject.- Returns:
result- Throws:
IOException
-
doLink
Do link- Specified by:
doLinkin classRefUpdate- Parameters:
target- aStringobject.- Returns:
RefUpdate.Result.NEWon success.- Throws:
IOException
-