lib/remote: Store name of remote providing keyring for dynamic remotes
When pulling from a dynamic (peer to peer) remote, the remote’s name is set to a unique, generated string which doesn’t exist in repo/config. If doing a non-mirror pull, however, we don’t want to use this name in the refspecs for newly created or updated refs — we want to use the name of the remote which provided the keyring for the pull (this will be a remote from repo/config whose collection ID matches that being used for the peer to peer pull). Store both names in OstreeRemote. The name to use for refspecs is stored as refspec_name, and is typically NULL unless it differs from name. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1202 Approved by: cgwalters
This commit is contained in:
1 parent
22c1fdfbd3
commit
69e332a0c0
4 files changed
+21
-5
No files matched your search
@@ -35,17 +35,24 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* @refspec_name is set if this is a dynamic remote. It’s the name of the static
|
||||
* remote which this one inherits from, and is what should be used in refspecs
|
||||
* for pulls from this remote. If it’s %NULL, @name should be used instead. */
|
||||
struct OstreeRemote {
|
||||
volatile int ref_count;
|
||||
char *name; /* (not nullable) */
|
||||
char *refspec_name; /* (nullable) */
|
||||
char *group; /* group name in options (not nullable) */
|
||||
char *keyring; /* keyring name (NAME.trustedkeys.gpg) (not nullable) */
|
||||
char *keyring; /* keyring name ($refspec_name.trustedkeys.gpg) (not nullable) */
|
||||
GFile *file; /* NULL if remote defined in repo/config */
|
||||
GKeyFile *options;
|
||||
};
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
OstreeRemote *ostree_remote_new (const gchar *name);
|
||||
G_GNUC_INTERNAL
|
||||
OstreeRemote *ostree_remote_new_dynamic (const gchar *name,
|
||||
const gchar *refspec_name);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
OstreeRemote *ostree_remote_new_from_keyfile (GKeyFile *keyfile,
|
||||
|
||||
Reference in new issue
Block a user