GgitRemote

GgitRemote

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GgitRemoteHead
    GEnum
    ╰── GgitRemoteDownloadTagsType
    GObject
    ╰── GgitObjectFactoryBase
        ╰── GgitNative
            ╰── GgitRemote

Description

Functions

GgitRemoteListCallback ()

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().

Parameters

name

the name of the reference.

 

oid

the reference's oid.

 

loid

the reference's loid.

 

local

if available locally.

 

user_data

user-supplied data.

[closure]

Returns

0 to go continue or a GgitError in case there was an error.


ggit_remote_new ()

GgitRemote *
ggit_remote_new (GgitRepository *repository,
                 const gchar *name,
                 const gchar *url,
                 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.

Parameters

repository

a GgitRepository.

 

name

the remote's name.

 

url

the remote repository's URL.

 

error

a GError for error reporting, or NULL.

 

Returns

a newly allocated GgitRemote.

[transfer full]


ggit_remote_save ()

void
ggit_remote_save (GgitRemote *remote,
                  GError **error);

Saves a remote to its repository's configuration.

Parameters

remote

a GgitRemote.

 

error

a GError or NULL.

 

ggit_remote_get_name ()

const gchar *
ggit_remote_get_name (GgitRemote *remote);

Gets the remote's name.

Parameters

remote

a GgitRemote.

 

Returns

the name of remote .


ggit_remote_get_url ()

const gchar *
ggit_remote_get_url (GgitRemote *remote);

Gets the remote's url.

Parameters

remote

GgitRemote.

 

Returns

the url of remote .


ggit_remote_connect ()

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.

Parameters

remote

a GgitRemote.

 

direction

whether you want to receive or send data.

 

error

a GError for error reporting, or NULL.

 

ggit_remote_get_connected ()

gboolean
ggit_remote_get_connected (GgitRemote *remote);

Check whether remote is connected.

Parameters

remote

a GgitRemote.

 

Returns

TRUE if it is connected.


ggit_remote_disconnect ()

void
ggit_remote_disconnect (GgitRemote *remote);

Closes the connection to the remote and frees the underlying transport.

Parameters

remote

a GgitRemote.

 

ggit_remote_add_fetch_spec ()

void
ggit_remote_add_fetch_spec (GgitRemote *remote,
                            const gchar *fetch_spec,
                            GError **error);

Sets remote 's fetch spec to fetch_spec .

Parameters

remote

a GgitRemote.

 

fetch_spec

the fetch refspec.

 

error

a GError for error reporting, or NULL.

 

ggit_remote_add_push_spec ()

void
ggit_remote_add_push_spec (GgitRemote *remote,
                           const gchar *push_spec,
                           GError **error);

Sets remote 's push spec to fetch_spec .

Parameters

remote

a GgitRemote.

 

push_spec

the push refspec.

 

error

a GError for error reporting, or NULL.

 

ggit_remote_list ()

GgitRemoteHead **
ggit_remote_list (GgitRemote *remote,
                  GError **error);

Get a list of refs at the remote.

Parameters

remote

a GgitRemote.

 

error

a GError for error reporting, or NULL.

 

Returns

the remote heads.

[array zero-terminated=1]


ggit_remote_is_valid_url ()

gboolean
ggit_remote_is_valid_url (const gchar *url);

Checks if url is a valid remote URL.

Parameters

url

a url string.

 

Returns

whether a string is a valid remote URL.


ggit_remote_is_supported_url ()

gboolean
ggit_remote_is_supported_url (const gchar *url);

Checks if url is a supported remote URL.

Parameters

url

a url string.

 

Returns

whether a string is a supported remote URL.


ggit_remote_head_get_local_oid ()

GgitOId *
ggit_remote_head_get_local_oid (GgitRemoteHead *remote_head);

Get the local oid of the remote head.

Parameters

remote_head

a GgitRemoteHead.

 

Returns

the local oid.

[transfer none]


ggit_remote_head_get_name ()

const gchar *
ggit_remote_head_get_name (GgitRemoteHead *remote_head);

Get the remote head name.

Parameters

remote_head

a GgitRemoteHead.

 

Returns

the remote head name.


ggit_remote_head_get_oid ()

GgitOId *
ggit_remote_head_get_oid (GgitRemoteHead *remote_head);

Get the remote oid of the remote head.

Parameters

remote_head

a GgitRemoteHead.

 

Returns

the remote oid.

[transfer none]


ggit_remote_head_get_type ()

GType
ggit_remote_head_get_type (void);

ggit_remote_head_is_local ()

gboolean
ggit_remote_head_is_local (GgitRemoteHead *remote_head);

Get whether the remote head is local.

Parameters

remote_head

a GgitRemoteHead.

 

Returns

whether the remote head is local.


ggit_remote_head_ref ()

GgitRemoteHead *
ggit_remote_head_ref (GgitRemoteHead *remote_head);

ggit_remote_head_unref ()

void
ggit_remote_head_unref (GgitRemoteHead *remote_head);

Types and Values

GgitRemote

typedef struct _GgitRemote GgitRemote;

Represents a git remote.


GgitRemoteHead

typedef struct _GgitRemoteHead GgitRemoteHead;

Represents a git remote head.


enum GgitRemoteDownloadTagsType

Members

GGIT_REMOTE_DOWNLOAD_TAGS_AUTO

   

GGIT_REMOTE_DOWNLOAD_TAGS_NONE

   

GGIT_REMOTE_DOWNLOAD_TAGS_ALL