class Scanner
extends java.lang.Object
RefTree
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
Scanner.Result |
Modifier and Type | Field and Description |
---|---|
private static byte[] |
BINARY_R_REFS |
private static int |
MAX_SYMLINK_BYTES |
private static byte[] |
REFS_DOT_DOT |
Modifier | Constructor and Description |
---|---|
private |
Scanner() |
Modifier and Type | Method and Description |
---|---|
private static CanonicalTreeParser |
createParserAtPath(ObjectReader reader,
AnyObjectId srcId,
java.lang.String prefix) |
private static boolean |
curElementHasPeelSuffix(AbstractTreeIterator itr) |
private static void |
peel(RefList.Builder<Ref> all,
CanonicalTreeParser p) |
private static java.lang.String |
refName(CanonicalTreeParser p,
boolean peel) |
private static Ref |
resolve(Ref ref,
int depth,
RefList<Ref> refs) |
private static void |
scan(ObjectReader reader,
AnyObjectId srcId,
java.lang.String prefix,
boolean recursive,
RefList.Builder<Ref> all,
RefList.Builder<Ref> sym) |
(package private) static Scanner.Result |
scanRefTree(Repository repo,
Ref src,
java.lang.String prefix,
boolean recursive)
|
private static Ref |
toRef(ObjectReader reader,
int mode,
CanonicalTreeParser p) |
private static RevTree |
toTree(ObjectReader reader,
AnyObjectId id) |
private static final int MAX_SYMLINK_BYTES
private static final byte[] BINARY_R_REFS
private static final byte[] REFS_DOT_DOT
static Scanner.Result scanRefTree(Repository repo, @Nullable Ref src, java.lang.String prefix, boolean recursive) throws java.io.IOException
repo
- source repository containing the commit and tree objects that
make up the RefTree.src
- bootstrap reference such as refs/txn/committed
to read
the reference tree tip from. The current ObjectId will be
included in Scanner.Result.refTreeId
.prefix
- if non-empty a reference prefix to scan only a subdirectory.
For example prefix = "refs/heads/"
will limit the scan
to only the "heads"
directory of the RefTree, avoiding
other directories like "tags"
. Empty string reads all
entries in the RefTree.recursive
- if true recurse into subdirectories of the reference tree;
false to read only one level. Callers may use false during an
implementation of exactRef(String)
where only one
reference is needed out of a specific subtree.java.io.IOException
- tree cannot be accessed from the repository.private static void scan(ObjectReader reader, AnyObjectId srcId, java.lang.String prefix, boolean recursive, RefList.Builder<Ref> all, RefList.Builder<Ref> sym) throws IncorrectObjectTypeException, java.io.IOException
IncorrectObjectTypeException
java.io.IOException
private static CanonicalTreeParser createParserAtPath(ObjectReader reader, AnyObjectId srcId, java.lang.String prefix) throws java.io.IOException
java.io.IOException
private static Ref resolve(Ref ref, int depth, RefList<Ref> refs) throws java.io.IOException
java.io.IOException
private static RevTree toTree(ObjectReader reader, AnyObjectId id) throws java.io.IOException
java.io.IOException
private static boolean curElementHasPeelSuffix(AbstractTreeIterator itr)
private static void peel(RefList.Builder<Ref> all, CanonicalTreeParser p)
private static Ref toRef(ObjectReader reader, int mode, CanonicalTreeParser p) throws java.io.IOException
java.io.IOException
private static java.lang.String refName(CanonicalTreeParser p, boolean peel)