Class FileReftableDatabase.FileReftableRefUpdate
- java.lang.Object
-
- org.eclipse.jgit.lib.RefUpdate
-
- org.eclipse.jgit.internal.storage.file.FileReftableDatabase.FileReftableRefUpdate
-
- Enclosing class:
- FileReftableDatabase
private class FileReftableDatabase.FileReftableRefUpdate extends RefUpdate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.RefUpdate
RefUpdate.Result
-
-
Constructor Summary
Constructors Constructor Description FileReftableRefUpdate(Ref ref)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RefUpdate.ResultdoDelete(RefUpdate.Result desiredResult)Do deleteprotected RefUpdate.ResultdoLink(java.lang.String target)Do linkprotected RefUpdate.ResultdoUpdate(RefUpdate.Result desiredResult)Do updateprotected RefDatabasegetRefDatabase()Get the reference database this update modifies.PersonIdentgetRefLogIdent()Get identity of the user making the change in the reflog.protected RepositorygetRepository()Get 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.RefUpdate.Resultupdate(RevWalk walk)Gracefully update the ref to the new value.(package private) voidwriteDelete(ReftableWriter w)(package private) voidwriteLink(ReftableWriter w)(package private) voidwriteUpdate(ReftableWriter w)-
Methods inherited from class org.eclipse.jgit.lib.RefUpdate
delete, delete, disableRefLog, forceUpdate, getExpectedOldObjectId, getName, getNewObjectId, getOldObjectId, getPushCertificate, getRef, getRefLogMessage, getResult, isDetachingSymbolicRef, isForceRefLog, isForceUpdate, isRefLogIncludingResult, link, setCheckConflicting, setDetachingSymbolicRef, setExpectedOldObjectId, setForceRefLog, setForceUpdate, setNewObjectId, setOldObjectId, setPushCertificate, setRefLogIdent, setRefLogMessage, update
-
-
-
-
Constructor Detail
-
FileReftableRefUpdate
FileReftableRefUpdate(Ref ref)
-
-
Method Detail
-
getRefDatabase
protected RefDatabase getRefDatabase()
Description copied from class:RefUpdateGet the reference database this update modifies.- Specified by:
getRefDatabasein classRefUpdate- Returns:
- the reference database this update modifies.
-
getRepository
protected Repository getRepository()
Description copied from class:RefUpdateGet the repository storing the database's objects.- Specified by:
getRepositoryin classRefUpdate- Returns:
- the repository storing the database's objects.
-
unlock
protected void unlock()
Description copied from class:RefUpdateReleases the lock taken byRefUpdate.tryLock(boolean)if it succeeded.
-
update
public RefUpdate.Result update(RevWalk walk) throws java.io.IOException
Description copied from class:RefUpdateGracefully 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:
java.io.IOException- an unexpected IO error occurred while writing changes.
-
tryLock
protected boolean tryLock(boolean deref) throws java.io.IOExceptionDescription copied from class:RefUpdateTry 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:
java.io.IOException- the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.
-
writeUpdate
void writeUpdate(ReftableWriter w) throws java.io.IOException
- Throws:
java.io.IOException
-
getRefLogIdent
public PersonIdent getRefLogIdent()
Description copied from class:RefUpdateGet identity of the user making the change in the reflog.- Overrides:
getRefLogIdentin classRefUpdate- Returns:
- identity of the user making the change in the reflog.
-
writeDelete
void writeDelete(ReftableWriter w) throws java.io.IOException
- Throws:
java.io.IOException
-
doUpdate
protected RefUpdate.Result doUpdate(RefUpdate.Result desiredResult) throws java.io.IOException
Description copied from class:RefUpdateDo update- Specified by:
doUpdatein classRefUpdate- Parameters:
desiredResult- aRefUpdate.Resultobject.- Returns:
result- Throws:
java.io.IOException
-
doDelete
protected RefUpdate.Result doDelete(RefUpdate.Result desiredResult) throws java.io.IOException
Description copied from class:RefUpdateDo delete- Specified by:
doDeletein classRefUpdate- Parameters:
desiredResult- aRefUpdate.Resultobject.- Returns:
result- Throws:
java.io.IOException
-
writeLink
void writeLink(ReftableWriter w) throws java.io.IOException
- Throws:
java.io.IOException
-
doLink
protected RefUpdate.Result doLink(java.lang.String target) throws java.io.IOException
Description copied from class:RefUpdateDo link- Specified by:
doLinkin classRefUpdate- Parameters:
target- aStringobject.- Returns:
RefUpdate.Result.NEWon success.- Throws:
java.io.IOException
-
-