org.eclipse.jgit.lib.RefDatabase .
This is the classical reference database representation for a Git repository. References are stored in two formats: loose, and packed.
Loose references are stored as individual files within the refs/
directory. The file name matches the reference name and the file contents is
the current org. in string form.
Packed references are stored in a single text file named packed-refs.
In the packed format, each reference is stored on its own line. This file
reduces the number of files needed for large reference spaces, reducing the
overall size of a Git repository on disk.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static interface | |
| private class | |
| private static class | |
| private static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final CoreConfig | |
| private final File | |
| private final File | |
| pack-priv final ReentrantLock | inProcessPackedRefsLock
Lock for coordinating operations within a single process that may contend
on the |
| private final AtomicInteger | lastNotifiedModCnt
Last |
| private static final Logger | |
| pack-priv final File | |
| pack-priv final File | |
| private final AtomicReference | looseRefs
Immutable sorted list of loose references. |
| private final AtomicInteger | modCnt
Number of modifications made to this database. |
| private static final RefDirectory. | |
| public static final String | PACKED_REFS_HEADER
Magic string denoting the header of a packed-refs file. |
| public static final String | PACKED_REFS_PEELED
If in the header, denotes the file has peeled data. |
| pack-priv final AtomicReference | packedRefs
Immutable sorted list of packed references. |
| pack-priv final File | |
| private final FileRepository | |
| pack-priv final File | |
| private static final List | |
| private List | |
| public static final String | SYMREF
Magic string denoting the start of a symbolic reference file. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Implements abstract org. Close any resources held by this database. |
| pack-priv void | commitPackedRefs(final LockFile lck, final RefList<Ref> refs, final RefDirectory.
|
| pack-priv void | |
| private static String | |
| public void | create()
Implements abstract org. Initialize a new reference database at this location. |
| pack-priv RefDirectoryRename | |
| pack-priv RefDirectoryUpdate | |
| public SnapshottingRefDirectory | |
| pack-priv void | |
| pack-priv static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private ObjectIdRef | |
| public Ref | exactRef(String
the unabbreviated name of the reference. name)Implements abstract org. Read a single reference. |
| public Map | exactRef(String...
the unabbreviated names of references to look up. refs)Overrides org. Read the specified references. |
| pack-priv File | |
| pack-priv void | |
| public Ref | firstExactRef(String...
the unabbreviated names of references to look up. refs)Overrides org. Find the first named reference. |
| public List | getAdditionalRefs()
Implements abstract org. Get the additional reference-like entities from the repository. |
| pack-priv RefDirectory. | |
| public ReflogReader | getReflogReader(Ref
a Ref ref)Implements abstract org. Get the reflog reader. |
| public Map | getRefs(String
prefix to search the namespace with; must end with prefix)/.
If the empty string (ALL), obtain a complete snapshot
of all references.Implements abstract org. Get a section of the reference namespace. |
| public List | getRefsByPrefix(String...
strings that names of refs should start with. prefixes)Overrides org. Returns refs whose names start with one of the given prefixes. |
| pack-priv Repository | |
| pack-priv Iterable | Returns: iterable of times, in milliseconds, that the caller should sleep before attempting an operation.Get times to sleep while retrying a possibly contentious operation. |
| private boolean | |
| private boolean | |
| pack-priv boolean | Returns: true if we are currently cloning a repositoryDetect if we are in a clone command execution |
| public boolean | isNameConflicting(String
proposed name. name)Implements abstract org. Determine if a proposed reference name overlaps with an existing one. |
| private static boolean | |
| pack-priv static int | |
| pack-priv LockFile | |
| pack-priv LockFile | |
| pack-priv void | |
| public File | |
| public PackedBatchRefUpdate | newBatchUpdate()
Overrides org. Create a new batch update to attempt on this database. |
| public PackedBatchRefUpdate | Returns: a new batch update objectwhether loose refs should be locked during the batch ref
update. Note that this should only be set to shouldLockLooseRefs)false if
the application using this ensures that no other ref updates
run concurrently to avoid lost updates caused by a race. In
such cases it can improve performance.Create a new batch update to attempt on this database. |
| pack-priv ReflogWriter | |
| public RefDirectoryRename | newRename(String
name of reference to rename from fromName, String name of reference to rename to toName)Implements abstract org. Create a new update command to rename a reference. |
| private static RefDirectory. | |
| pack-priv RefDirectoryUpdate | Returns: an update for a new temporary reference.Create a reference update to write a temporary reference. |
| public RefDirectoryUpdate | newUpdate(String
the name of the reference. name, boolean if detach)true and name is currently a
org., the update will
replace it with an org..
Otherwise, the update will recursively traverse
org.s and operate on the
leaf org..Implements abstract org. Create a new update command to create, modify or delete a reference. |
| public void | |
| pack-priv void | |
| private void | |
| public void | packRefs(ProgressMonitor
a progress monitor pm, PackRefsCommand PackRefsCommand to control ref packing behaviorOverrides org. Optimize pack ref storage. |
| private RefList | |
| public Ref | peel(Ref
The reference to peel ref)Implements abstract org. Peel a possibly unpeeled reference by traversing the annotated tags. |
| private Ref | Returns: a ref for Storage PACKED having the same name, id, peeledId as fgiven ref ref)Make sure a ref is peeled and has the Storage PACKED. |
| public boolean | performsAtomicTransactions()
Overrides org. Whether the database is capable of performing batch updates as atomic transactions. |
| private void | |
| private Ref | |
| private RefDirectory. | |
| private Ref | |
| private static Ref | |
| public void | refresh()
Overrides org. Triggers a refresh of all internal data structures. |
| pack-priv RefDirectory. | |
| private RefDirectory. | |
| pack-priv void | refreshPathToLooseRef(Path
path of a loose ref relative to the repository root refPath)Workaround for issues caused by NFS caching. |
| private Ref | |
| pack-priv RefDirectory. | |
| pack-priv void | |
| pack-priv static void | sleep(long
time to sleep, in milliseconds; zero or negative is a no-op. ms)Sleep with |
| pack-priv void | |
| pack-priv void | |
| private RefList |