Push certificates are stored in a special ref refs/meta/push-certs.
The filenames in the tree are ref names followed by the special suffix
@{cert}, and the contents are the latest push cert affecting
that ref. The special suffix allows storing certificates for both refs/foo
and refs/foo/bar in case those both existed at some point.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv RevCommit | |
| private final Repository | |
| private final List | |
| pack-priv ObjectReader | |
| pack-priv static final String | REF_NAME
Ref name storing push certificates. |
| Access | Constructor and Description |
|---|---|
| public | PushCertificateStore(Repository
the repository. db)Create a new store backed by the given repository. |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public void | |
| public void | close()
Implements java. Closes this resource, relinquishing any underlying resources. |
| private static boolean | |
| public PushCertificate | |
| public Iterable | |
| pack-priv void | |
| private DirCache | |
| private TreeWalk | |
| pack-priv static String | |
| public void | put(PushCertificate
certificate to store. cert, PersonIdent identity for the commit that stores this certificate. Pending
certificates are sorted by identity timestamp during
ident)save().Put a certificate to be saved to the store. |
| public void | put(PushCertificate
certificate to store. cert, PersonIdent identity for the commit that stores this certificate. Pending
certificates are sorted by identity timestamp during
ident, Collection<ReceiveCommand> save().only store certs for the refs listed in this list whose values
match the commands in the cert. matching)Put a certificate to be saved to the store, matching a set of commands. |
| pack-priv static PushCertificate | |
| public RefUpdate. | |
| public boolean | Returns: whether a command was added to the batch.update to save to. batch)Save pending certificates to the store in an existing batch ref update. |
| private ObjectId | |
| private static void | |
| private RefUpdate. | |
| private ObjectId |
| commit | back to summary |
|---|---|
| pack-priv RevCommit commit | |
| db | back to summary |
|---|---|
| private final Repository db | |
| pending | back to summary |
|---|---|
| private final List<PushCertificateStore. | |
| reader | back to summary |
|---|---|
| pack-priv ObjectReader reader | |
| REF_NAME | back to summary |
|---|---|
| pack-priv static final String REF_NAME Ref name storing push certificates. | |
| PushCertificateStore | back to summary |
|---|---|
| public PushCertificateStore(Repository db) Create a new store backed by the given repository.
| |
| buildMessage | back to summary |
|---|---|
| private static String buildMessage(PushCertificate cert) | |
| clear | back to summary |
|---|---|
| public void clear() Clear pending certificates added with | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Close resources opened by this store.
If
| |
| commandsEqual | back to summary |
|---|---|
| private static boolean commandsEqual(ReceiveCommand c1, ReceiveCommand c2) | |
| get | back to summary |
|---|---|
| public PushCertificate get(String refName) throws IOException Get latest push certificate associated with a ref.
Lazily opens
| |
| getAll | back to summary |
|---|---|
| public Iterable Iterate over all push certificates affecting a ref. Only includes push certificates actually stored in the tree; see class Javadoc for conditions where this might not include all push certs ever seen for this ref.
The returned iterable may be iterated multiple times, and push certs will
be re-read from the current state of the store on each call to
| |
| load | back to summary |
|---|---|
| pack-priv void load() throws IOException | |
| newDirCache | back to summary |
|---|---|
| private DirCache newDirCache() throws IOException | |
| newTreeWalk | back to summary |
|---|---|
| private TreeWalk newTreeWalk(String refName) throws IOException | |
| pathName | back to summary |
|---|---|
| pack-priv static String pathName(String refName) | |
| put | back to summary |
|---|---|
| public void put(PushCertificate cert, PersonIdent ident) Put a certificate to be saved to the store. Writes the contents of this certificate for each ref mentioned. It is up to the caller to ensure this certificate accurately represents the state of the ref.
Pending certificates added to this method are not returned by
| |
| put | back to summary |
|---|---|
| public void put(PushCertificate cert, PersonIdent ident, Collection<ReceiveCommand> matching) Put a certificate to be saved to the store, matching a set of commands.
Like
Pending certificates added to this method are not returned by
| |
| read | back to summary |
|---|---|
| pack-priv static PushCertificate read(TreeWalk tw) throws IOException | |
| save | back to summary |
|---|---|
| public RefUpdate. Save pending certificates to the store.
One commit is created per certificate added with
The pending list is cleared if and only the ref update fails, which allows for easy retries in case of lock failure.
| |
| save | back to summary |
|---|---|
| public boolean save(BatchRefUpdate batch) throws IOException Save pending certificates to the store in an existing batch ref update.
One commit is created per certificate added with
The cached ref value and pending list are not cleared. If the
ref update succeeds, the caller is responsible for calling
| |
| saveCert | back to summary |
|---|---|
| private ObjectId saveCert(ObjectInserter inserter, DirCache dc, PushCertificateStore. | |
| sortPending | back to summary |
|---|---|
| private static void sortPending(List<PushCertificateStore. | |
| updateRef | back to summary |
|---|---|
| private RefUpdate. | |
| write | back to summary |
|---|---|
| private ObjectId write() throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv PushCertificate | |
| pack-priv PersonIdent | |
| pack-priv Collection |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| cert | back to summary |
|---|---|
| pack-priv PushCertificate cert | |
| ident | back to summary |
|---|---|
| pack-priv PersonIdent ident | |
| matching | back to summary |
|---|---|
| pack-priv Collection<ReceiveCommand> matching | |
| PendingCert | back to summary |
|---|---|
| pack-priv PendingCert(PushCertificate cert, PersonIdent ident, Collection<ReceiveCommand> matching) | |