Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: refs.h
/*
[0] Fix | Delete
* Copyright (C) the libgit2 contributors. All rights reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* This file is part of libgit2, distributed under the GNU GPL v2 with
[3] Fix | Delete
* a Linking Exception. For full terms see the included COPYING file.
[4] Fix | Delete
*/
[5] Fix | Delete
#ifndef INCLUDE_git_refs_h__
[6] Fix | Delete
#define INCLUDE_git_refs_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
#include "types.h"
[10] Fix | Delete
#include "oid.h"
[11] Fix | Delete
#include "strarray.h"
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* @file git2/refs.h
[15] Fix | Delete
* @brief Git reference management routines
[16] Fix | Delete
* @defgroup git_reference Git reference management routines
[17] Fix | Delete
* @ingroup Git
[18] Fix | Delete
* @{
[19] Fix | Delete
*/
[20] Fix | Delete
GIT_BEGIN_DECL
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Lookup a reference by name in a repository.
[24] Fix | Delete
*
[25] Fix | Delete
* The returned reference must be freed by the user.
[26] Fix | Delete
*
[27] Fix | Delete
* The name will be checked for validity.
[28] Fix | Delete
* See `git_reference_symbolic_create()` for rules about valid names.
[29] Fix | Delete
*
[30] Fix | Delete
* @param out pointer to the looked-up reference
[31] Fix | Delete
* @param repo the repository to look up the reference
[32] Fix | Delete
* @param name the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)
[33] Fix | Delete
* @return 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code.
[34] Fix | Delete
*/
[35] Fix | Delete
GIT_EXTERN(int) git_reference_lookup(git_reference **out, git_repository *repo, const char *name);
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Lookup a reference by name and resolve immediately to OID.
[39] Fix | Delete
*
[40] Fix | Delete
* This function provides a quick way to resolve a reference name straight
[41] Fix | Delete
* through to the object id that it refers to. This avoids having to
[42] Fix | Delete
* allocate or free any `git_reference` objects for simple situations.
[43] Fix | Delete
*
[44] Fix | Delete
* The name will be checked for validity.
[45] Fix | Delete
* See `git_reference_symbolic_create()` for rules about valid names.
[46] Fix | Delete
*
[47] Fix | Delete
* @param out Pointer to oid to be filled in
[48] Fix | Delete
* @param repo The repository in which to look up the reference
[49] Fix | Delete
* @param name The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)
[50] Fix | Delete
* @return 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code.
[51] Fix | Delete
*/
[52] Fix | Delete
GIT_EXTERN(int) git_reference_name_to_id(
[53] Fix | Delete
git_oid *out, git_repository *repo, const char *name);
[54] Fix | Delete
[55] Fix | Delete
/**
[56] Fix | Delete
* Lookup a reference by DWIMing its short name
[57] Fix | Delete
*
[58] Fix | Delete
* Apply the git precendence rules to the given shorthand to determine
[59] Fix | Delete
* which reference the user is referring to.
[60] Fix | Delete
*
[61] Fix | Delete
* @param out pointer in which to store the reference
[62] Fix | Delete
* @param repo the repository in which to look
[63] Fix | Delete
* @param shorthand the short name for the reference
[64] Fix | Delete
* @return 0 or an error code
[65] Fix | Delete
*/
[66] Fix | Delete
GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, const char *shorthand);
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Conditionally create a new symbolic reference.
[70] Fix | Delete
*
[71] Fix | Delete
* A symbolic reference is a reference name that refers to another
[72] Fix | Delete
* reference name. If the other name moves, the symbolic name will move,
[73] Fix | Delete
* too. As a simple example, the "HEAD" reference might refer to
[74] Fix | Delete
* "refs/heads/master" while on the "master" branch of a repository.
[75] Fix | Delete
*
[76] Fix | Delete
* The symbolic reference will be created in the repository and written to
[77] Fix | Delete
* the disk. The generated reference object must be freed by the user.
[78] Fix | Delete
*
[79] Fix | Delete
* Valid reference names must follow one of two patterns:
[80] Fix | Delete
*
[81] Fix | Delete
* 1. Top-level names must contain only capital letters and underscores,
[82] Fix | Delete
* and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
[83] Fix | Delete
* 2. Names prefixed with "refs/" can be almost anything. You must avoid
[84] Fix | Delete
* the characters '~', '^', ':', '\\', '?', '[', and '*', and the
[85] Fix | Delete
* sequences ".." and "@{" which have special meaning to revparse.
[86] Fix | Delete
*
[87] Fix | Delete
* This function will return an error if a reference already exists with the
[88] Fix | Delete
* given name unless `force` is true, in which case it will be overwritten.
[89] Fix | Delete
*
[90] Fix | Delete
* The message for the reflog will be ignored if the reference does
[91] Fix | Delete
* not belong in the standard set (HEAD, branches and remote-tracking
[92] Fix | Delete
* branches) and it does not have a reflog.
[93] Fix | Delete
*
[94] Fix | Delete
* It will return GIT_EMODIFIED if the reference's value at the time
[95] Fix | Delete
* of updating does not match the one passed through `current_value`
[96] Fix | Delete
* (i.e. if the ref has changed since the user read it).
[97] Fix | Delete
*
[98] Fix | Delete
* @param out Pointer to the newly created reference
[99] Fix | Delete
* @param repo Repository where that reference will live
[100] Fix | Delete
* @param name The name of the reference
[101] Fix | Delete
* @param target The target of the reference
[102] Fix | Delete
* @param force Overwrite existing references
[103] Fix | Delete
* @param current_value The expected value of the reference when updating
[104] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[105] Fix | Delete
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code
[106] Fix | Delete
*/
[107] Fix | Delete
GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message);
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Create a new symbolic reference.
[111] Fix | Delete
*
[112] Fix | Delete
* A symbolic reference is a reference name that refers to another
[113] Fix | Delete
* reference name. If the other name moves, the symbolic name will move,
[114] Fix | Delete
* too. As a simple example, the "HEAD" reference might refer to
[115] Fix | Delete
* "refs/heads/master" while on the "master" branch of a repository.
[116] Fix | Delete
*
[117] Fix | Delete
* The symbolic reference will be created in the repository and written to
[118] Fix | Delete
* the disk. The generated reference object must be freed by the user.
[119] Fix | Delete
*
[120] Fix | Delete
* Valid reference names must follow one of two patterns:
[121] Fix | Delete
*
[122] Fix | Delete
* 1. Top-level names must contain only capital letters and underscores,
[123] Fix | Delete
* and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
[124] Fix | Delete
* 2. Names prefixed with "refs/" can be almost anything. You must avoid
[125] Fix | Delete
* the characters '~', '^', ':', '\\', '?', '[', and '*', and the
[126] Fix | Delete
* sequences ".." and "@{" which have special meaning to revparse.
[127] Fix | Delete
*
[128] Fix | Delete
* This function will return an error if a reference already exists with the
[129] Fix | Delete
* given name unless `force` is true, in which case it will be overwritten.
[130] Fix | Delete
*
[131] Fix | Delete
* The message for the reflog will be ignored if the reference does
[132] Fix | Delete
* not belong in the standard set (HEAD, branches and remote-tracking
[133] Fix | Delete
* branches) and it does not have a reflog.
[134] Fix | Delete
*
[135] Fix | Delete
* @param out Pointer to the newly created reference
[136] Fix | Delete
* @param repo Repository where that reference will live
[137] Fix | Delete
* @param name The name of the reference
[138] Fix | Delete
* @param target The target of the reference
[139] Fix | Delete
* @param force Overwrite existing references
[140] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[141] Fix | Delete
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
[142] Fix | Delete
*/
[143] Fix | Delete
GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message);
[144] Fix | Delete
[145] Fix | Delete
/**
[146] Fix | Delete
* Create a new direct reference.
[147] Fix | Delete
*
[148] Fix | Delete
* A direct reference (also called an object id reference) refers directly
[149] Fix | Delete
* to a specific object id (a.k.a. OID or SHA) in the repository. The id
[150] Fix | Delete
* permanently refers to the object (although the reference itself can be
[151] Fix | Delete
* moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"
[152] Fix | Delete
* refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.
[153] Fix | Delete
*
[154] Fix | Delete
* The direct reference will be created in the repository and written to
[155] Fix | Delete
* the disk. The generated reference object must be freed by the user.
[156] Fix | Delete
*
[157] Fix | Delete
* Valid reference names must follow one of two patterns:
[158] Fix | Delete
*
[159] Fix | Delete
* 1. Top-level names must contain only capital letters and underscores,
[160] Fix | Delete
* and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
[161] Fix | Delete
* 2. Names prefixed with "refs/" can be almost anything. You must avoid
[162] Fix | Delete
* the characters '~', '^', ':', '\\', '?', '[', and '*', and the
[163] Fix | Delete
* sequences ".." and "@{" which have special meaning to revparse.
[164] Fix | Delete
*
[165] Fix | Delete
* This function will return an error if a reference already exists with the
[166] Fix | Delete
* given name unless `force` is true, in which case it will be overwritten.
[167] Fix | Delete
*
[168] Fix | Delete
* The message for the reflog will be ignored if the reference does
[169] Fix | Delete
* not belong in the standard set (HEAD, branches and remote-tracking
[170] Fix | Delete
* branches) and and it does not have a reflog.
[171] Fix | Delete
*
[172] Fix | Delete
* @param out Pointer to the newly created reference
[173] Fix | Delete
* @param repo Repository where that reference will live
[174] Fix | Delete
* @param name The name of the reference
[175] Fix | Delete
* @param id The object id pointed to by the reference.
[176] Fix | Delete
* @param force Overwrite existing references
[177] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[178] Fix | Delete
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
[179] Fix | Delete
*/
[180] Fix | Delete
GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message);
[181] Fix | Delete
[182] Fix | Delete
/**
[183] Fix | Delete
* Conditionally create new direct reference
[184] Fix | Delete
*
[185] Fix | Delete
* A direct reference (also called an object id reference) refers directly
[186] Fix | Delete
* to a specific object id (a.k.a. OID or SHA) in the repository. The id
[187] Fix | Delete
* permanently refers to the object (although the reference itself can be
[188] Fix | Delete
* moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"
[189] Fix | Delete
* refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.
[190] Fix | Delete
*
[191] Fix | Delete
* The direct reference will be created in the repository and written to
[192] Fix | Delete
* the disk. The generated reference object must be freed by the user.
[193] Fix | Delete
*
[194] Fix | Delete
* Valid reference names must follow one of two patterns:
[195] Fix | Delete
*
[196] Fix | Delete
* 1. Top-level names must contain only capital letters and underscores,
[197] Fix | Delete
* and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
[198] Fix | Delete
* 2. Names prefixed with "refs/" can be almost anything. You must avoid
[199] Fix | Delete
* the characters '~', '^', ':', '\\', '?', '[', and '*', and the
[200] Fix | Delete
* sequences ".." and "@{" which have special meaning to revparse.
[201] Fix | Delete
*
[202] Fix | Delete
* This function will return an error if a reference already exists with the
[203] Fix | Delete
* given name unless `force` is true, in which case it will be overwritten.
[204] Fix | Delete
*
[205] Fix | Delete
* The message for the reflog will be ignored if the reference does
[206] Fix | Delete
* not belong in the standard set (HEAD, branches and remote-tracking
[207] Fix | Delete
* branches) and and it does not have a reflog.
[208] Fix | Delete
*
[209] Fix | Delete
* It will return GIT_EMODIFIED if the reference's value at the time
[210] Fix | Delete
* of updating does not match the one passed through `current_id`
[211] Fix | Delete
* (i.e. if the ref has changed since the user read it).
[212] Fix | Delete
*
[213] Fix | Delete
* @param out Pointer to the newly created reference
[214] Fix | Delete
* @param repo Repository where that reference will live
[215] Fix | Delete
* @param name The name of the reference
[216] Fix | Delete
* @param id The object id pointed to by the reference.
[217] Fix | Delete
* @param force Overwrite existing references
[218] Fix | Delete
* @param current_id The expected value of the reference at the time of update
[219] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[220] Fix | Delete
* @return 0 on success, GIT_EMODIFIED if the value of the reference
[221] Fix | Delete
* has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
[222] Fix | Delete
*/
[223] Fix | Delete
GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message);
[224] Fix | Delete
[225] Fix | Delete
/**
[226] Fix | Delete
* Get the OID pointed to by a direct reference.
[227] Fix | Delete
*
[228] Fix | Delete
* Only available if the reference is direct (i.e. an object id reference,
[229] Fix | Delete
* not a symbolic one).
[230] Fix | Delete
*
[231] Fix | Delete
* To find the OID of a symbolic ref, call `git_reference_resolve()` and
[232] Fix | Delete
* then this function (or maybe use `git_reference_name_to_id()` to
[233] Fix | Delete
* directly resolve a reference name all the way through to an OID).
[234] Fix | Delete
*
[235] Fix | Delete
* @param ref The reference
[236] Fix | Delete
* @return a pointer to the oid if available, NULL otherwise
[237] Fix | Delete
*/
[238] Fix | Delete
GIT_EXTERN(const git_oid *) git_reference_target(const git_reference *ref);
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* Return the peeled OID target of this reference.
[242] Fix | Delete
*
[243] Fix | Delete
* This peeled OID only applies to direct references that point to
[244] Fix | Delete
* a hard Tag object: it is the result of peeling such Tag.
[245] Fix | Delete
*
[246] Fix | Delete
* @param ref The reference
[247] Fix | Delete
* @return a pointer to the oid if available, NULL otherwise
[248] Fix | Delete
*/
[249] Fix | Delete
GIT_EXTERN(const git_oid *) git_reference_target_peel(const git_reference *ref);
[250] Fix | Delete
[251] Fix | Delete
/**
[252] Fix | Delete
* Get full name to the reference pointed to by a symbolic reference.
[253] Fix | Delete
*
[254] Fix | Delete
* Only available if the reference is symbolic.
[255] Fix | Delete
*
[256] Fix | Delete
* @param ref The reference
[257] Fix | Delete
* @return a pointer to the name if available, NULL otherwise
[258] Fix | Delete
*/
[259] Fix | Delete
GIT_EXTERN(const char *) git_reference_symbolic_target(const git_reference *ref);
[260] Fix | Delete
[261] Fix | Delete
/**
[262] Fix | Delete
* Get the type of a reference.
[263] Fix | Delete
*
[264] Fix | Delete
* Either direct (GIT_REFERENCE_DIRECT) or symbolic (GIT_REFERENCE_SYMBOLIC)
[265] Fix | Delete
*
[266] Fix | Delete
* @param ref The reference
[267] Fix | Delete
* @return the type
[268] Fix | Delete
*/
[269] Fix | Delete
GIT_EXTERN(git_reference_t) git_reference_type(const git_reference *ref);
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* Get the full name of a reference.
[273] Fix | Delete
*
[274] Fix | Delete
* See `git_reference_symbolic_create()` for rules about valid names.
[275] Fix | Delete
*
[276] Fix | Delete
* @param ref The reference
[277] Fix | Delete
* @return the full name for the ref
[278] Fix | Delete
*/
[279] Fix | Delete
GIT_EXTERN(const char *) git_reference_name(const git_reference *ref);
[280] Fix | Delete
[281] Fix | Delete
/**
[282] Fix | Delete
* Resolve a symbolic reference to a direct reference.
[283] Fix | Delete
*
[284] Fix | Delete
* This method iteratively peels a symbolic reference until it resolves to
[285] Fix | Delete
* a direct reference to an OID.
[286] Fix | Delete
*
[287] Fix | Delete
* The peeled reference is returned in the `resolved_ref` argument, and
[288] Fix | Delete
* must be freed manually once it's no longer needed.
[289] Fix | Delete
*
[290] Fix | Delete
* If a direct reference is passed as an argument, a copy of that
[291] Fix | Delete
* reference is returned. This copy must be manually freed too.
[292] Fix | Delete
*
[293] Fix | Delete
* @param out Pointer to the peeled reference
[294] Fix | Delete
* @param ref The reference
[295] Fix | Delete
* @return 0 or an error code
[296] Fix | Delete
*/
[297] Fix | Delete
GIT_EXTERN(int) git_reference_resolve(git_reference **out, const git_reference *ref);
[298] Fix | Delete
[299] Fix | Delete
/**
[300] Fix | Delete
* Get the repository where a reference resides.
[301] Fix | Delete
*
[302] Fix | Delete
* @param ref The reference
[303] Fix | Delete
* @return a pointer to the repo
[304] Fix | Delete
*/
[305] Fix | Delete
GIT_EXTERN(git_repository *) git_reference_owner(const git_reference *ref);
[306] Fix | Delete
[307] Fix | Delete
/**
[308] Fix | Delete
* Create a new reference with the same name as the given reference but a
[309] Fix | Delete
* different symbolic target. The reference must be a symbolic reference,
[310] Fix | Delete
* otherwise this will fail.
[311] Fix | Delete
*
[312] Fix | Delete
* The new reference will be written to disk, overwriting the given reference.
[313] Fix | Delete
*
[314] Fix | Delete
* The target name will be checked for validity.
[315] Fix | Delete
* See `git_reference_symbolic_create()` for rules about valid names.
[316] Fix | Delete
*
[317] Fix | Delete
* The message for the reflog will be ignored if the reference does
[318] Fix | Delete
* not belong in the standard set (HEAD, branches and remote-tracking
[319] Fix | Delete
* branches) and and it does not have a reflog.
[320] Fix | Delete
*
[321] Fix | Delete
* @param out Pointer to the newly created reference
[322] Fix | Delete
* @param ref The reference
[323] Fix | Delete
* @param target The new target for the reference
[324] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[325] Fix | Delete
* @return 0 on success, GIT_EINVALIDSPEC or an error code
[326] Fix | Delete
*/
[327] Fix | Delete
GIT_EXTERN(int) git_reference_symbolic_set_target(
[328] Fix | Delete
git_reference **out,
[329] Fix | Delete
git_reference *ref,
[330] Fix | Delete
const char *target,
[331] Fix | Delete
const char *log_message);
[332] Fix | Delete
[333] Fix | Delete
/**
[334] Fix | Delete
* Conditionally create a new reference with the same name as the given reference but a
[335] Fix | Delete
* different OID target. The reference must be a direct reference, otherwise
[336] Fix | Delete
* this will fail.
[337] Fix | Delete
*
[338] Fix | Delete
* The new reference will be written to disk, overwriting the given reference.
[339] Fix | Delete
*
[340] Fix | Delete
* @param out Pointer to the newly created reference
[341] Fix | Delete
* @param ref The reference
[342] Fix | Delete
* @param id The new target OID for the reference
[343] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[344] Fix | Delete
* @return 0 on success, GIT_EMODIFIED if the value of the reference
[345] Fix | Delete
* has changed since it was read, or an error code
[346] Fix | Delete
*/
[347] Fix | Delete
GIT_EXTERN(int) git_reference_set_target(
[348] Fix | Delete
git_reference **out,
[349] Fix | Delete
git_reference *ref,
[350] Fix | Delete
const git_oid *id,
[351] Fix | Delete
const char *log_message);
[352] Fix | Delete
[353] Fix | Delete
/**
[354] Fix | Delete
* Rename an existing reference.
[355] Fix | Delete
*
[356] Fix | Delete
* This method works for both direct and symbolic references.
[357] Fix | Delete
*
[358] Fix | Delete
* The new name will be checked for validity.
[359] Fix | Delete
* See `git_reference_symbolic_create()` for rules about valid names.
[360] Fix | Delete
*
[361] Fix | Delete
* If the `force` flag is not enabled, and there's already
[362] Fix | Delete
* a reference with the given name, the renaming will fail.
[363] Fix | Delete
*
[364] Fix | Delete
* IMPORTANT:
[365] Fix | Delete
* The user needs to write a proper reflog entry if the
[366] Fix | Delete
* reflog is enabled for the repository. We only rename
[367] Fix | Delete
* the reflog if it exists.
[368] Fix | Delete
*
[369] Fix | Delete
* @param ref The reference to rename
[370] Fix | Delete
* @param new_name The new name for the reference
[371] Fix | Delete
* @param force Overwrite an existing reference
[372] Fix | Delete
* @param log_message The one line long message to be appended to the reflog
[373] Fix | Delete
* @return 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
[374] Fix | Delete
*
[375] Fix | Delete
*/
[376] Fix | Delete
GIT_EXTERN(int) git_reference_rename(
[377] Fix | Delete
git_reference **new_ref,
[378] Fix | Delete
git_reference *ref,
[379] Fix | Delete
const char *new_name,
[380] Fix | Delete
int force,
[381] Fix | Delete
const char *log_message);
[382] Fix | Delete
[383] Fix | Delete
/**
[384] Fix | Delete
* Delete an existing reference.
[385] Fix | Delete
*
[386] Fix | Delete
* This method works for both direct and symbolic references. The reference
[387] Fix | Delete
* will be immediately removed on disk but the memory will not be freed.
[388] Fix | Delete
* Callers must call `git_reference_free`.
[389] Fix | Delete
*
[390] Fix | Delete
* This function will return an error if the reference has changed
[391] Fix | Delete
* from the time it was looked up.
[392] Fix | Delete
*
[393] Fix | Delete
* @param ref The reference to remove
[394] Fix | Delete
* @return 0, GIT_EMODIFIED or an error code
[395] Fix | Delete
*/
[396] Fix | Delete
GIT_EXTERN(int) git_reference_delete(git_reference *ref);
[397] Fix | Delete
[398] Fix | Delete
/**
[399] Fix | Delete
* Delete an existing reference by name
[400] Fix | Delete
*
[401] Fix | Delete
* This method removes the named reference from the repository without
[402] Fix | Delete
* looking at its old value.
[403] Fix | Delete
*
[404] Fix | Delete
* @param name The reference to remove
[405] Fix | Delete
* @return 0 or an error code
[406] Fix | Delete
*/
[407] Fix | Delete
GIT_EXTERN(int) git_reference_remove(git_repository *repo, const char *name);
[408] Fix | Delete
[409] Fix | Delete
/**
[410] Fix | Delete
* Fill a list with all the references that can be found in a repository.
[411] Fix | Delete
*
[412] Fix | Delete
* The string array will be filled with the names of all references; these
[413] Fix | Delete
* values are owned by the user and should be free'd manually when no
[414] Fix | Delete
* longer needed, using `git_strarray_free()`.
[415] Fix | Delete
*
[416] Fix | Delete
* @param array Pointer to a git_strarray structure where
[417] Fix | Delete
* the reference names will be stored
[418] Fix | Delete
* @param repo Repository where to find the refs
[419] Fix | Delete
* @return 0 or an error code
[420] Fix | Delete
*/
[421] Fix | Delete
GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo);
[422] Fix | Delete
[423] Fix | Delete
/**
[424] Fix | Delete
* Callback used to iterate over references
[425] Fix | Delete
*
[426] Fix | Delete
* @see git_reference_foreach
[427] Fix | Delete
*
[428] Fix | Delete
* @param reference The reference object
[429] Fix | Delete
* @param payload Payload passed to git_reference_foreach
[430] Fix | Delete
* @return non-zero to terminate the iteration
[431] Fix | Delete
*/
[432] Fix | Delete
typedef int GIT_CALLBACK(git_reference_foreach_cb)(git_reference *reference, void *payload);
[433] Fix | Delete
[434] Fix | Delete
/**
[435] Fix | Delete
* Callback used to iterate over reference names
[436] Fix | Delete
*
[437] Fix | Delete
* @see git_reference_foreach_name
[438] Fix | Delete
*
[439] Fix | Delete
* @param name The reference name
[440] Fix | Delete
* @param payload Payload passed to git_reference_foreach_name
[441] Fix | Delete
* @return non-zero to terminate the iteration
[442] Fix | Delete
*/
[443] Fix | Delete
typedef int GIT_CALLBACK(git_reference_foreach_name_cb)(const char *name, void *payload);
[444] Fix | Delete
[445] Fix | Delete
/**
[446] Fix | Delete
* Perform a callback on each reference in the repository.
[447] Fix | Delete
*
[448] Fix | Delete
* The `callback` function will be called for each reference in the
[449] Fix | Delete
* repository, receiving the reference object and the `payload` value
[450] Fix | Delete
* passed to this method. Returning a non-zero value from the callback
[451] Fix | Delete
* will terminate the iteration.
[452] Fix | Delete
*
[453] Fix | Delete
* Note that the callback function is responsible to call `git_reference_free`
[454] Fix | Delete
* on each reference passed to it.
[455] Fix | Delete
*
[456] Fix | Delete
* @param repo Repository where to find the refs
[457] Fix | Delete
* @param callback Function which will be called for every listed ref
[458] Fix | Delete
* @param payload Additional data to pass to the callback
[459] Fix | Delete
* @return 0 on success, non-zero callback return value, or error code
[460] Fix | Delete
*/
[461] Fix | Delete
GIT_EXTERN(int) git_reference_foreach(
[462] Fix | Delete
git_repository *repo,
[463] Fix | Delete
git_reference_foreach_cb callback,
[464] Fix | Delete
void *payload);
[465] Fix | Delete
[466] Fix | Delete
/**
[467] Fix | Delete
* Perform a callback on the fully-qualified name of each reference.
[468] Fix | Delete
*
[469] Fix | Delete
* The `callback` function will be called for each reference in the
[470] Fix | Delete
* repository, receiving the name of the reference and the `payload` value
[471] Fix | Delete
* passed to this method. Returning a non-zero value from the callback
[472] Fix | Delete
* will terminate the iteration.
[473] Fix | Delete
*
[474] Fix | Delete
* @param repo Repository where to find the refs
[475] Fix | Delete
* @param callback Function which will be called for every listed ref name
[476] Fix | Delete
* @param payload Additional data to pass to the callback
[477] Fix | Delete
* @return 0 on success, non-zero callback return value, or error code
[478] Fix | Delete
*/
[479] Fix | Delete
GIT_EXTERN(int) git_reference_foreach_name(
[480] Fix | Delete
git_repository *repo,
[481] Fix | Delete
git_reference_foreach_name_cb callback,
[482] Fix | Delete
void *payload);
[483] Fix | Delete
[484] Fix | Delete
/**
[485] Fix | Delete
* Create a copy of an existing reference.
[486] Fix | Delete
*
[487] Fix | Delete
* Call `git_reference_free` to free the data.
[488] Fix | Delete
*
[489] Fix | Delete
* @param dest pointer where to store the copy
[490] Fix | Delete
* @param source object to copy
[491] Fix | Delete
* @return 0 or an error code
[492] Fix | Delete
*/
[493] Fix | Delete
GIT_EXTERN(int) git_reference_dup(git_reference **dest, git_reference *source);
[494] Fix | Delete
[495] Fix | Delete
/**
[496] Fix | Delete
* Free the given reference.
[497] Fix | Delete
*
[498] Fix | Delete
* @param ref git_reference
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function