Top Fields Constructors Methods
org.eclipse.jgit.internal.storage.dfs

pack-priv final Class DfsRefUpdate

extends RefUpdate
Class Inheritance
Imports
java.io.IOException, org.eclipse.jgit.lib.ObjectIdRef, .Ref, .Ref.Storage, .RefUpdate, .SymbolicRef, org.eclipse.jgit.revwalk.RevObject, .RevTag, .RevWalk

Field Summary

Modifier and TypeField and Description
private Ref
private final DfsRefDatabase
private RevWalk

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected RefUpdate.Result
protected RefUpdate.Result
protected DfsRefDatabase
getRefDatabase()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Get the reference database this update modifies.

protected DfsRepository
getRepository()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRepository.

Get the repository storing the database's objects.

protected boolean
tryLock(boolean
true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.
deref
)

Implements abstract org.eclipse.jgit.lib.RefUpdate.tryLock.

Try to acquire the lock on the reference.

protected void
unlock()

Implements abstract org.eclipse.jgit.lib.RefUpdate.unlock.

Releases the lock taken by tryLock if it succeeded.

public RefUpdate.Result
update(RevWalk
a RevWalk instance this update command can borrow to perform the merge test. The walk will be reset to perform the test.
walk
)

Overrides org.eclipse.jgit.lib.RefUpdate.update.

Gracefully update the ref to the new value.

Inherited from org.eclipse.jgit.lib.RefUpdate:
deletedeletedisableRefLogforceUpdategetExpectedOldObjectIdgetNamegetNewObjectIdgetOldObjectIdgetPushCertificategetRefgetRefLogIdentgetRefLogMessagegetResultisDetachingSymbolicRefisForceRefLogisForceUpdateisRefLogIncludingResultlinksetCheckConflictingsetDetachingSymbolicRefsetExpectedOldObjectIdsetForceRefLogsetForceUpdatesetNewObjectIdsetOldObjectIdsetPushCertificatesetRefLogIdentsetRefLogMessageupdate

Field Detail

dstRefback to summary
private Ref dstRef
refdbback to summary
private final DfsRefDatabase refdb
rwback to summary
private RevWalk rw

Constructor Detail

DfsRefUpdateback to summary
pack-priv DfsRefUpdate(DfsRefDatabase refdb, Ref ref)

Method Detail

doDeleteback to summary
protected RefUpdate.Result doDelete(RefUpdate.Result desiredResult) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.doDelete.

Doc from org.eclipse.jgit.lib.RefUpdate.doDelete.

Do delete

Parameters
desiredResult:RefUpdate.Result

a org.eclipse.jgit.lib.RefUpdate.Result object.

Returns:RefUpdate.Result

result

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
doUpdateback to summary
protected RefUpdate.Result doUpdate(RefUpdate.Result desiredResult) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.doUpdate.

Doc from org.eclipse.jgit.lib.RefUpdate.doUpdate.

Do update

Parameters
desiredResult:RefUpdate.Result

a org.eclipse.jgit.lib.RefUpdate.Result object.

Returns:RefUpdate.Result

result

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
getRefDatabaseback to summary
protected DfsRefDatabase getRefDatabase()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Doc from org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Get the reference database this update modifies.

Returns:DfsRefDatabase

the reference database this update modifies.

Annotations
@Override
getRepositoryback to summary
protected DfsRepository getRepository()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRepository.

Doc from org.eclipse.jgit.lib.RefUpdate.getRepository.

Get the repository storing the database's objects.

Returns:DfsRepository

the repository storing the database's objects.

Annotations
@Override
tryLockback to summary
protected boolean tryLock(boolean deref) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.tryLock.

Doc from org.eclipse.jgit.lib.RefUpdate.tryLock.

Try to acquire the lock on the reference.

If the locking was successful the implementor must set the current identity value by calling setOldObjectId(ObjectId).

Parameters
deref:boolean

true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.

Returns:boolean

true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.

Annotations
@Override
Exceptions
IOException:
the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.
unlockback to summary
protected void unlock()

Implements abstract org.eclipse.jgit.lib.RefUpdate.unlock.

Doc from org.eclipse.jgit.lib.RefUpdate.unlock.

Releases the lock taken by tryLock if it succeeded.

Annotations
@Override
updateback to summary
public RefUpdate.Result update(RevWalk walk) throws IOException

Overrides org.eclipse.jgit.lib.RefUpdate.update.

Doc from org.eclipse.jgit.lib.RefUpdate.update.

Gracefully update the ref to the new value.

Merge test will be performed according to isForceUpdate().

Parameters
walk:RevWalk

a RevWalk instance this update command can borrow to perform the merge test. The walk will be reset to perform the test.

Returns:RefUpdate.Result

the result status of the update.

Annotations
@Override
Exceptions
IOException:
an unexpected IO error occurred while writing changes.