![]() |
![]() |
![]() |
libgit2-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
GgitRemote; enum GgitRemoteDownloadTagsType; gint (*GgitRemoteListCallback) (const gchar *name
,GgitOId *oid
,GgitOId *loid
,gboolean local
,gpointer user_data
); GgitRemote * ggit_remote_new (GgitRepository *repository
,const gchar *url
,const gchar *fetch_spec
,GError **error
); GgitRemote * ggit_remote_ref (GgitRemote *remote
); void ggit_remote_unref (GgitRemote *remote
); void ggit_remote_save (GgitRemote *remote
,GError **error
); const gchar * ggit_remote_get_name (GgitRemote *remote
); const gchar * ggit_remote_get_url (GgitRemote *remote
); void ggit_remote_connect (GgitRemote *remote
,gboolean direction
,GError **error
); gboolean ggit_remote_get_connected (GgitRemote *remote
); void ggit_remote_disconnect (GgitRemote *remote
); void ggit_remote_add_fetch_spec (GgitRemote *remote
,const gchar *fetch_spec
,GError **error
); void ggit_remote_add_push_spec (GgitRemote *remote
,const gchar *push_spec
,GError **error
); void ggit_remote_list (GgitRemote *remote
,GgitRemoteListCallback callback
,gpointer user_data
,GError **error
); gboolean ggit_remote_is_valid_url (const gchar *url
); gboolean ggit_remote_is_supported_url (const gchar *url
);
typedef enum { GGIT_REMOTE_DOWNLOAD_TAGS_AUTO = 0, GGIT_REMOTE_DOWNLOAD_TAGS_NONE = 1, GGIT_REMOTE_DOWNLOAD_TAGS_ALL = 2 } GgitRemoteDownloadTagsType;
gint (*GgitRemoteListCallback) (const gchar *name
,GgitOId *oid
,GgitOId *loid
,gboolean local
,gpointer user_data
);
The type of the callback functions for listing the references of a
GgitRemote. See ggit_remote_list()
.
|
the name of the reference. |
|
the reference's oid. |
|
the reference's loid. |
|
if available locally. |
|
user-supplied data. [closure] |
Returns : |
0 to go continue or a GgitError in case there was an error. |
GgitRemote * ggit_remote_new (GgitRepository *repository
,const gchar *url
,const gchar *fetch_spec
,GError **error
);
Creates a remote with the default refspecs in memory. You can use this when you have a URL instead of a remote's name.
|
a GgitRepository. |
|
the remote repository's URL. |
|
the fetch refspec to use for this remote. |
|
a GError for error reporting, or NULL . |
Returns : |
a newly allocated GgitRemote. [transfer full] |
GgitRemote * ggit_remote_ref (GgitRemote *remote
);
Atomically increments the reference count of remote
by one.
This function is MT-safe and may be called from any thread.
|
a GgitRemote. |
Returns : |
the passed in GgitRemote. [transfer none] |
void ggit_remote_unref (GgitRemote *remote
);
Atomically decrements the reference count of remote
by one.
If the reference count drops to 0, remote
is freed.
|
a GgitRemote. |
void ggit_remote_save (GgitRemote *remote
,GError **error
);
Saves a remote to its repository's configuration.
|
a GgitRemote. |
|
a GError or NULL . |
const gchar * ggit_remote_get_name (GgitRemote *remote
);
Gets the remote's name.
|
a GgitRemote. |
Returns : |
the name of remote . |
const gchar * ggit_remote_get_url (GgitRemote *remote
);
Gets the remote's url.
|
GgitRemote. |
Returns : |
the url of remote . |
void ggit_remote_connect (GgitRemote *remote
,gboolean direction
,GError **error
);
Opens a connection to a remote. The transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.
|
a GgitRemote. |
|
whether you want to receive or send data. |
|
a GError for error reporting, or NULL . |
gboolean ggit_remote_get_connected (GgitRemote *remote
);
Check whether remote
is connected.
|
a GgitRemote. |
Returns : |
TRUE if it is connected. |
void ggit_remote_disconnect (GgitRemote *remote
);
Closes the connection to the remote and frees the underlying transport.
|
a GgitRemote. |
void ggit_remote_add_fetch_spec (GgitRemote *remote
,const gchar *fetch_spec
,GError **error
);
Sets remote
's fetch spec to fetch_spec
.
|
a GgitRemote. |
|
the fetch refspec. |
|
a GError for error reporting, or NULL . |
void ggit_remote_add_push_spec (GgitRemote *remote
,const gchar *push_spec
,GError **error
);
Sets remote
's push spec to fetch_spec
.
|
a GgitRemote. |
|
the push refspec. |
|
a GError for error reporting, or NULL . |
void ggit_remote_list (GgitRemote *remote
,GgitRemoteListCallback callback
,gpointer user_data
,GError **error
);
Calls callback
for each ref at remote
.
|
a GgitRemote. |
|
a GgitRemoteListCallback. [scope call][closure user_data] |
|
callback user data. |
|
a GError for error reporting, or NULL . |
gboolean ggit_remote_is_valid_url (const gchar *url
);
Checks if url
is a valid remote URL.
|
a url string. |
Returns : |
whether a string is a valid remote URL. |