Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

public Class FileReftableDatabase

extends RefDatabase
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Ref.UNDEFINED_UPDATE_INDEX, .Ref.Storage.NEW, .Ref.Storage.PACKED

Implements RefDatabase using reftable for storage. This class is threadsafe.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final FileRepository
private final ReftableDatabase
private final FileReftableStack
Inherited from org.eclipse.jgit.lib.RefDatabase:
additionalRefsNamesALLMAX_SYMBOLIC_REF_DEPTHSEARCH_PATH

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
private void
public void
close()

Implements abstract org.eclipse.jgit.lib.RefDatabase.close.

Close any resources held by this database.

public void
compactFully()

Runs a full compaction for GC purposes.

public static FileReftableDatabase

Returns:

a reftable based RefDB from an existing repository.
convertFrom
(FileRepository
the repository
repo
,
boolean
whether to write reflogs
writeLogs
)

Convert FileRepository to a FileReftableDatabase

public void
create()

Implements abstract org.eclipse.jgit.lib.RefDatabase.create.

Initialize a new reference database at this location.

private Ref
doPeel(Ref leaf)

public Ref
exactRef(String
the unabbreviated name of the reference.
name
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.exactRef.

Read a single reference.

public List<Ref>
getAdditionalRefs()

Implements abstract org.eclipse.jgit.lib.RefDatabase.getAdditionalRefs.

Get the additional reference-like entities from the repository.

private ReentrantLock
public ReflogReader
getReflogReader(Ref
a Ref
ref
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.getReflogReader.

Get the reflog reader.

public ReflogReader
public List<Ref>
getRefs()

Overrides org.eclipse.jgit.lib.RefDatabase.getRefs.

Returns all refs.

public Map<String, Ref>
getRefs(String
prefix to search the namespace with; must end with /. If the empty string (ALL), obtain a complete snapshot of all references.
prefix
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.getRefs.

Get a section of the reference namespace.

public List<Ref>
getRefsByPrefixWithExclusions(String
string that names of refs should start with; may be empty.
include
,
Set<String>
strings that names of refs can't start with; may be empty.
excludes
)

Overrides org.eclipse.jgit.lib.RefDatabase.getRefsByPrefixWithExclusions.

Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes.

public boolean
hasFastTipsWithSha1()

Overrides org.eclipse.jgit.lib.RefDatabase.hasFastTipsWithSha1.

If the ref database does not support fast inverse queries, it may be advantageous to build a complete SHA1 to ref map in advance for multiple uses.

public boolean

Returns:

whether the reftable stack is auto-refreshed if it is out of date.
isAutoRefresh
()

Whether the reftable stack is auto-refreshed if it is out of date.

public boolean
isNameConflicting(String
proposed name.
name
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.isNameConflicting.

Determine if a proposed reference name overlaps with an existing one.

public static boolean

Returns:

whether the given repo uses reftable for refdb storage.
isReftable
(File
the repository's metadata directory
repoDir
)

Whether the given repo uses reftable for refdb storage

public BatchRefUpdate
newBatchUpdate()

Overrides org.eclipse.jgit.lib.RefDatabase.newBatchUpdate.

Create a new batch update to attempt on this database.

public RefRename
newRename(String
name of reference to rename from
fromName
,
String
name of reference to rename to
toName
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.newRename.

Create a new update command to rename a reference.

public RefUpdate
newUpdate(String
the name of the reference.
refName
,
boolean
if true and name is currently a org.eclipse.jgit.lib.SymbolicRef, the update will replace it with an org.eclipse.jgit.lib.ObjectIdRef. Otherwise, the update will recursively traverse org.eclipse.jgit.lib.SymbolicRefs and operate on the leaf org.eclipse.jgit.lib.ObjectIdRef.
detach
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.newUpdate.

Create a new update command to create, modify or delete a reference.

public void
packRefs(ProgressMonitor
a progress monitor
pm
,
PackRefsCommand
PackRefsCommand to control ref packing behavior
packRefs
)

Overrides org.eclipse.jgit.lib.RefDatabase.packRefs.

Optimize pack ref storage.

public Ref
peel(Ref
The reference to peel
ref
)

Implements abstract org.eclipse.jgit.lib.RefDatabase.peel.

Peel a possibly unpeeled reference by traversing the annotated tags.

public boolean
performsAtomicTransactions()

Overrides org.eclipse.jgit.lib.RefDatabase.performsAtomicTransactions.

Whether the database is capable of performing batch updates as atomic transactions.

private static Ref
recreate(Ref old, Ref leaf, boolean hasVersioning)

private static Ref
public void
refresh()

Overrides org.eclipse.jgit.lib.RefDatabase.refresh.

Check if the reftable stack is up to date, and if not, reload it.

public void
setAutoRefresh(boolean
whether to auto-refresh the reftable stack if it is out of date.
autoRefresh
)

Whether to auto-refresh the reftable stack if it is out of date.

private static void
writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs)

Inherited from org.eclipse.jgit.lib.RefDatabase:
exactReffindReffindReffirstExactRefgetConflictingNamesgetRefsByPrefixgetRefsByPrefixgetTipsWithSha1hasRefshasVersioning

Field Detail

autoRefreshback to summary
private final AtomicBoolean autoRefresh
fileRepositoryback to summary
private final FileRepository fileRepository
reftableDatabaseback to summary
private final ReftableDatabase reftableDatabase
reftableStackback to summary
private final FileReftableStack reftableStack

Constructor Detail

FileReftableDatabaseback to summary
pack-priv FileReftableDatabase(FileRepository repo) throws IOException
FileReftableDatabaseback to summary
pack-priv FileReftableDatabase(FileRepository repo, File refstackName) throws IOException

Method Detail

addReftableback to summary
private boolean addReftable(FileReftableStack.Writer w) throws IOException
autoRefreshback to summary
private void autoRefresh()
closeback to summary
public void close()

Implements abstract org.eclipse.jgit.lib.RefDatabase.close.

Doc from org.eclipse.jgit.lib.RefDatabase.close.

Close any resources held by this database.

Annotations
@Override
compactFullyback to summary
public void compactFully() throws IOException

Runs a full compaction for GC purposes.

Exceptions
IOException:
on I/O errors
convertFromback to summary
public static FileReftableDatabase convertFrom(FileRepository repo, boolean writeLogs) throws IOException

Convert FileRepository to a FileReftableDatabase

Parameters
repo:FileRepository

the repository

writeLogs:boolean

whether to write reflogs

Returns:FileReftableDatabase

a reftable based RefDB from an existing repository.

Exceptions
IOException:
on IO error
createback to summary
public void create() throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.create.

Doc from org.eclipse.jgit.lib.RefDatabase.create.

Initialize a new reference database at this location.

Annotations
@Override
Exceptions
IOException:
the database could not be created.
doPeelback to summary
private Ref doPeel(Ref leaf) throws IOException
exactRefback to summary
public Ref exactRef(String name) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.exactRef.

Doc from org.eclipse.jgit.lib.RefDatabase.exactRef.

Read a single reference.

Unlike findRef, this method expects an unshortened reference name and does not search using the standard SEARCH_PATH.

Parameters
name:String

the unabbreviated name of the reference.

Returns:Ref

the reference (if it exists); else null.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
getAdditionalRefsback to summary
public List<Ref> getAdditionalRefs() throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.getAdditionalRefs.

Doc from org.eclipse.jgit.lib.RefDatabase.getAdditionalRefs.

Get the additional reference-like entities from the repository.

The result list includes non-ref items such as MERGE_HEAD and FETCH_RESULT cast to be refs. The names of these refs are not returned by getRefs() but are accepted by findRef(String) and exactRef(String).

Returns:List<Ref>

a list of additional refs

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
getLockback to summary
private ReentrantLock getLock()
getReflogReaderback to summary
public ReflogReader getReflogReader(Ref ref) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.getReflogReader.

Doc from org.eclipse.jgit.lib.RefDatabase.getReflogReader.

Get the reflog reader.

Parameters
ref:Ref

a Ref

Returns:ReflogReader

a org.eclipse.jgit.lib.ReflogReader for the supplied ref.

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
getReflogReaderback to summary
public ReflogReader getReflogReader(String refname) throws IOException

Overrides org.eclipse.jgit.lib.RefDatabase.getReflogReader.

Doc from org.eclipse.jgit.lib.RefDatabase.getReflogReader.

Get the reflog reader

Parameters
refname:String

a java.lang.String object.

Returns:ReflogReader

a org.eclipse.jgit.lib.ReflogReader for the supplied refname, or null if the named ref does not exist.

Annotations
@Override
Exceptions
IOException:
the ref could not be accessed.
getRefsback to summary
public List<Ref> getRefs() throws IOException

Overrides org.eclipse.jgit.lib.RefDatabase.getRefs.

Doc from org.eclipse.jgit.lib.RefDatabase.getRefs.

Returns all refs.

This includes HEAD, branches under ref/heads/, tags under refs/tags/, etc. It does not include pseudo-refs like FETCH_HEAD; for those, see getAdditionalRefs.

Symbolic references to a non-existent ref (for example, HEAD pointing to a branch yet to be born) are not included.

Callers interested in only a portion of the ref hierarchy can call getRefsByPrefix instead.

Returns:List<Ref>

immutable list of all refs.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
getRefsback to summary
public Map<String, Ref> getRefs(String prefix) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.getRefs.

Doc from org.eclipse.jgit.lib.RefDatabase.getRefs.

Get a section of the reference namespace.

Parameters
prefix:String

prefix to search the namespace with; must end with /. If the empty string (ALL), obtain a complete snapshot of all references.

Returns:Map<String, Ref>

modifiable map that is a complete snapshot of the current reference namespace, with prefix removed from the start of each key. The map can be an unsorted map.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
getRefsByPrefixWithExclusionsback to summary
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes) throws IOException

Overrides org.eclipse.jgit.lib.RefDatabase.getRefsByPrefixWithExclusions.

Doc from org.eclipse.jgit.lib.RefDatabase.getRefsByPrefixWithExclusions.

Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes.

The default implementation is not efficient. Implementors of RefDatabase should override this method directly if a better implementation is possible.

Parameters
include:String

string that names of refs should start with; may be empty.

excludes:Set<String>

strings that names of refs can't start with; may be empty.

Returns:List<Ref>

immutable list of refs whose names start with prefix and none of the strings in excludes.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
hasFastTipsWithSha1back to summary
public boolean hasFastTipsWithSha1() throws IOException

Overrides org.eclipse.jgit.lib.RefDatabase.hasFastTipsWithSha1.

Doc from org.eclipse.jgit.lib.RefDatabase.hasFastTipsWithSha1.

If the ref database does not support fast inverse queries, it may be advantageous to build a complete SHA1 to ref map in advance for multiple uses. To let applications decide on this decision, this function indicates whether the inverse map is available.

Returns:boolean

whether this RefDatabase supports fast inverse ref queries.

Annotations
@Override
Exceptions
IOException:
on I/O problems.
isAutoRefreshback to summary
public boolean isAutoRefresh()

Whether the reftable stack is auto-refreshed if it is out of date.

Returns:boolean

whether the reftable stack is auto-refreshed if it is out of date.

isNameConflictingback to summary
public boolean isNameConflicting(String name) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.isNameConflicting.

Doc from org.eclipse.jgit.lib.RefDatabase.isNameConflicting.

Determine if a proposed reference name overlaps with an existing one.

Reference names use '/' as a component separator, and may be stored in a hierarchical storage such as a directory on the local filesystem.

If the reference "refs/heads/foo" exists then "refs/heads/foo/bar" must not exist, as a reference cannot have a value and also be a container for other references at the same time.

If the reference "refs/heads/foo/bar" exists than the reference "refs/heads/foo" cannot exist, for the same reason.

Parameters
name:String

proposed name.

Returns:boolean

true if the name overlaps with an existing reference; false if using this name right now would be safe.

Annotations
@Override
Exceptions
IOException:
the database could not be read to check for conflicts.
isReftableback to summary
public static boolean isReftable(File repoDir)

Whether the given repo uses reftable for refdb storage

Parameters
repoDir:File

the repository's metadata directory

Returns:boolean

whether the given repo uses reftable for refdb storage.

newBatchUpdateback to summary
public BatchRefUpdate newBatchUpdate()

Overrides org.eclipse.jgit.lib.RefDatabase.newBatchUpdate.

Doc from org.eclipse.jgit.lib.RefDatabase.newBatchUpdate.

Create a new batch update to attempt on this database.

The default implementation performs a sequential update of each command.

Returns:BatchRefUpdate

a new batch update object.

Annotations
@NonNull
@Override
newRenameback to summary
public RefRename newRename(String fromName, String toName) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.newRename.

Doc from org.eclipse.jgit.lib.RefDatabase.newRename.

Create a new update command to rename a reference.

Parameters
fromName:String

name of reference to rename from

toName:String

name of reference to rename to

Returns:RefRename

an update command that knows how to rename a branch to another.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
newUpdateback to summary
public RefUpdate newUpdate(String refName, boolean detach) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.newUpdate.

Doc from org.eclipse.jgit.lib.RefDatabase.newUpdate.

Create a new update command to create, modify or delete a reference.

Parameters
refName:String

the name of the reference.

detach:boolean

if true and name is currently a org.eclipse.jgit.lib.SymbolicRef, the update will replace it with an org.eclipse.jgit.lib.ObjectIdRef. Otherwise, the update will recursively traverse org.eclipse.jgit.lib.SymbolicRefs and operate on the leaf org.eclipse.jgit.lib.ObjectIdRef.

Returns:RefUpdate

a new update for the requested name; never null.

Annotations
@Override
Exceptions
IOException:
the reference space cannot be accessed.
packRefsback to summary
public void packRefs(ProgressMonitor pm, PackRefsCommand packRefs) throws IOException

Overrides org.eclipse.jgit.lib.RefDatabase.packRefs.

Doc from org.eclipse.jgit.lib.RefDatabase.packRefs.

Optimize pack ref storage. For Reftable, all the data is compacted into a single table.

Parameters
pm:ProgressMonitor

a progress monitor

packRefs:PackRefsCommand

PackRefsCommand to control ref packing behavior

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
peelback to summary
public Ref peel(Ref ref) throws IOException

Implements abstract org.eclipse.jgit.lib.RefDatabase.peel.

Doc from org.eclipse.jgit.lib.RefDatabase.peel.

Peel a possibly unpeeled reference by traversing the annotated tags.

If the reference cannot be peeled (as it does not refer to an annotated tag) the peeled id stays null, but org.eclipse.jgit.lib.Ref#isPeeled() will be true.

Implementors should check org.eclipse.jgit.lib.Ref#isPeeled() before performing any additional work effort.

Parameters
ref:Ref

The reference to peel

Returns:Ref

ref if ref.isPeeled() is true; otherwise a new Ref object representing the same data as Ref, but isPeeled() will be true and getPeeledObjectId() will contain the peeled object (or null).

Annotations
@Override
Exceptions
IOException:
the reference space or object space cannot be accessed.
performsAtomicTransactionsback to summary
public boolean performsAtomicTransactions()

Overrides org.eclipse.jgit.lib.RefDatabase.performsAtomicTransactions.

Doc from org.eclipse.jgit.lib.RefDatabase.performsAtomicTransactions.

Whether the database is capable of performing batch updates as atomic transactions.

If true, by default org.eclipse.jgit.lib.BatchRefUpdate instances will perform updates atomically, meaning either all updates will succeed, or all updates will fail. It is still possible to turn off this behavior on a per-batch basis by calling update.setAtomic(false).

If false, org.eclipse.jgit.lib.BatchRefUpdate instances will never perform updates atomically, and calling update.setAtomic(true) will cause the entire batch to fail with REJECTED_OTHER_REASON.

This definition of atomicity is stronger than what is provided by org.eclipse.jgit.transport.ReceivePack. ReceivePack will attempt to reject all commands if it knows in advance some commands may fail, even if the storage layer does not support atomic transactions. Here, atomicity applies even in the case of unforeseeable errors.

Returns:boolean

whether transactions are atomic by default.

Annotations
@Override
recreateback to summary
private static Ref recreate(Ref old, Ref leaf, boolean hasVersioning)
refForWriteback to summary
private static Ref refForWrite(RevWalk rw, Ref r) throws IOException
refreshback to summary
public void refresh()

Overrides org.eclipse.jgit.lib.RefDatabase.refresh.

Doc from org.eclipse.jgit.lib.RefDatabase.refresh.

Check if the reftable stack is up to date, and if not, reload it.

Triggers a refresh of all internal data structures.

In case the RefDatabase implementation has internal caches this method will trigger that all these caches are cleared.

Implementors should overwrite this method if they use any kind of caches.

Annotations
@Override
setAutoRefreshback to summary
public void setAutoRefresh(boolean autoRefresh)

Whether to auto-refresh the reftable stack if it is out of date.

Parameters
autoRefresh:boolean

whether to auto-refresh the reftable stack if it is out of date.

writeConvertTableback to summary
private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException
org.eclipse.jgit.internal.storage.file back to summary

private Class FileReftableDatabase.FileRefRename

extends RefRename
Class Inheritance

Field Summary

Inherited from org.eclipse.jgit.lib.RefRename:
destinationsource

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected RefUpdate.Result
doRename()

Implements abstract org.eclipse.jgit.lib.RefRename.doRename.

Do the actual rename

pack-priv void
Inherited from org.eclipse.jgit.lib.RefRename:
disableRefLoggetRefLogIdentgetRefLogMessagegetResultneedToUpdateHEADrenamesetRefLogIdentsetRefLogMessage

Constructor Detail

FileRefRenameback to summary
pack-priv FileRefRename(RefUpdate src, RefUpdate dst)

Method Detail

doRenameback to summary
protected RefUpdate.Result doRename() throws IOException

Implements abstract org.eclipse.jgit.lib.RefRename.doRename.

Doc from org.eclipse.jgit.lib.RefRename.doRename.

Do the actual rename

Returns:RefUpdate.Result

the result of the rename operation.

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
writeRenameback to summary
pack-priv void writeRename(ReftableWriter w) throws IOException
org.eclipse.jgit.internal.storage.file back to summary

private Class FileReftableDatabase.FileReftableBatchRefUpdate

extends ReftableBatchRefUpdate
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
applyUpdates(List<Ref>
the new refs to create
newRefs
,
List<ReceiveCommand>
the pending receive commands to be executed
pending
)

Implements abstract org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate.applyUpdates.

Implements the storage-specific part of the update.

Inherited from org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate:
executewrite

Constructor Detail

FileReftableBatchRefUpdateback to summary
pack-priv FileReftableBatchRefUpdate(FileReftableDatabase db, Repository repository)

Method Detail

applyUpdatesback to summary
protected void applyUpdates(List<Ref> newRefs, List<ReceiveCommand> pending) throws IOException

Implements abstract org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate.applyUpdates.

Doc from org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate.applyUpdates.

Implements the storage-specific part of the update.

Parameters
newRefs:List<Ref>

the new refs to create

pending:List<ReceiveCommand>

the pending receive commands to be executed

Annotations
@Override
Exceptions
IOException:
if any of the writes fail.
org.eclipse.jgit.internal.storage.file back to summary

private Class FileReftableDatabase.FileReftableRefUpdate

extends RefUpdate
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Ref
private RevWalk

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

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

Get the reference database this update modifies.

public PersonIdent
getRefLogIdent()

Overrides org.eclipse.jgit.lib.RefUpdate.getRefLogIdent.

Get identity of the user making the change in the reflog.

protected Repository
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.

pack-priv void
pack-priv void
Inherited from org.eclipse.jgit.lib.RefUpdate:
deletedeletedisableRefLogforceUpdategetExpectedOldObjectIdgetNamegetNewObjectIdgetOldObjectIdgetPushCertificategetRefgetRefLogMessagegetResultisDetachingSymbolicRefisForceRefLogisForceUpdateisRefLogIncludingResultlinksetCheckConflictingsetDetachingSymbolicRefsetExpectedOldObjectIdsetForceRefLogsetForceUpdatesetNewObjectIdsetOldObjectIdsetPushCertificatesetRefLogIdentsetRefLogMessageupdate

Field Detail

dstRefback to summary
private Ref dstRef
rwback to summary
private RevWalk rw

Constructor Detail

FileReftableRefUpdateback to summary
pack-priv FileReftableRefUpdate(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 RefDatabase 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:RefDatabase

the reference database this update modifies.

Annotations
@Override
getRefLogIdentback to summary
public PersonIdent getRefLogIdent()

Overrides org.eclipse.jgit.lib.RefUpdate.getRefLogIdent.

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

Get identity of the user making the change in the reflog.

Returns:PersonIdent

identity of the user making the change in the reflog.

Annotations
@Override
getRepositoryback to summary
protected Repository 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:Repository

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.
writeDeleteback to summary
pack-priv void writeDelete(ReftableWriter w) throws IOException
writeUpdateback to summary
pack-priv void writeUpdate(ReftableWriter w) throws IOException