Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: tree.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_tree_h__
[6] Fix | Delete
#define INCLUDE_git_tree_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 "object.h"
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* @file git2/tree.h
[15] Fix | Delete
* @brief Git tree parsing, loading routines
[16] Fix | Delete
* @defgroup git_tree Git tree parsing, loading 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 tree object from the repository.
[24] Fix | Delete
*
[25] Fix | Delete
* @param out Pointer to the looked up tree
[26] Fix | Delete
* @param repo The repo to use when locating the tree.
[27] Fix | Delete
* @param id Identity of the tree to locate.
[28] Fix | Delete
* @return 0 or an error code
[29] Fix | Delete
*/
[30] Fix | Delete
GIT_EXTERN(int) git_tree_lookup(
[31] Fix | Delete
git_tree **out, git_repository *repo, const git_oid *id);
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Lookup a tree object from the repository,
[35] Fix | Delete
* given a prefix of its identifier (short id).
[36] Fix | Delete
*
[37] Fix | Delete
* @see git_object_lookup_prefix
[38] Fix | Delete
*
[39] Fix | Delete
* @param out pointer to the looked up tree
[40] Fix | Delete
* @param repo the repo to use when locating the tree.
[41] Fix | Delete
* @param id identity of the tree to locate.
[42] Fix | Delete
* @param len the length of the short identifier
[43] Fix | Delete
* @return 0 or an error code
[44] Fix | Delete
*/
[45] Fix | Delete
GIT_EXTERN(int) git_tree_lookup_prefix(
[46] Fix | Delete
git_tree **out,
[47] Fix | Delete
git_repository *repo,
[48] Fix | Delete
const git_oid *id,
[49] Fix | Delete
size_t len);
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Close an open tree
[53] Fix | Delete
*
[54] Fix | Delete
* You can no longer use the git_tree pointer after this call.
[55] Fix | Delete
*
[56] Fix | Delete
* IMPORTANT: You MUST call this method when you stop using a tree to
[57] Fix | Delete
* release memory. Failure to do so will cause a memory leak.
[58] Fix | Delete
*
[59] Fix | Delete
* @param tree The tree to close
[60] Fix | Delete
*/
[61] Fix | Delete
GIT_EXTERN(void) git_tree_free(git_tree *tree);
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Get the id of a tree.
[65] Fix | Delete
*
[66] Fix | Delete
* @param tree a previously loaded tree.
[67] Fix | Delete
* @return object identity for the tree.
[68] Fix | Delete
*/
[69] Fix | Delete
GIT_EXTERN(const git_oid *) git_tree_id(const git_tree *tree);
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* Get the repository that contains the tree.
[73] Fix | Delete
*
[74] Fix | Delete
* @param tree A previously loaded tree.
[75] Fix | Delete
* @return Repository that contains this tree.
[76] Fix | Delete
*/
[77] Fix | Delete
GIT_EXTERN(git_repository *) git_tree_owner(const git_tree *tree);
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Get the number of entries listed in a tree
[81] Fix | Delete
*
[82] Fix | Delete
* @param tree a previously loaded tree.
[83] Fix | Delete
* @return the number of entries in the tree
[84] Fix | Delete
*/
[85] Fix | Delete
GIT_EXTERN(size_t) git_tree_entrycount(const git_tree *tree);
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Lookup a tree entry by its filename
[89] Fix | Delete
*
[90] Fix | Delete
* This returns a git_tree_entry that is owned by the git_tree. You don't
[91] Fix | Delete
* have to free it, but you must not use it after the git_tree is released.
[92] Fix | Delete
*
[93] Fix | Delete
* @param tree a previously loaded tree.
[94] Fix | Delete
* @param filename the filename of the desired entry
[95] Fix | Delete
* @return the tree entry; NULL if not found
[96] Fix | Delete
*/
[97] Fix | Delete
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(
[98] Fix | Delete
const git_tree *tree, const char *filename);
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* Lookup a tree entry by its position in the tree
[102] Fix | Delete
*
[103] Fix | Delete
* This returns a git_tree_entry that is owned by the git_tree. You don't
[104] Fix | Delete
* have to free it, but you must not use it after the git_tree is released.
[105] Fix | Delete
*
[106] Fix | Delete
* @param tree a previously loaded tree.
[107] Fix | Delete
* @param idx the position in the entry list
[108] Fix | Delete
* @return the tree entry; NULL if not found
[109] Fix | Delete
*/
[110] Fix | Delete
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(
[111] Fix | Delete
const git_tree *tree, size_t idx);
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* Lookup a tree entry by SHA value.
[115] Fix | Delete
*
[116] Fix | Delete
* This returns a git_tree_entry that is owned by the git_tree. You don't
[117] Fix | Delete
* have to free it, but you must not use it after the git_tree is released.
[118] Fix | Delete
*
[119] Fix | Delete
* Warning: this must examine every entry in the tree, so it is not fast.
[120] Fix | Delete
*
[121] Fix | Delete
* @param tree a previously loaded tree.
[122] Fix | Delete
* @param id the sha being looked for
[123] Fix | Delete
* @return the tree entry; NULL if not found
[124] Fix | Delete
*/
[125] Fix | Delete
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byid(
[126] Fix | Delete
const git_tree *tree, const git_oid *id);
[127] Fix | Delete
[128] Fix | Delete
/**
[129] Fix | Delete
* Retrieve a tree entry contained in a tree or in any of its subtrees,
[130] Fix | Delete
* given its relative path.
[131] Fix | Delete
*
[132] Fix | Delete
* Unlike the other lookup functions, the returned tree entry is owned by
[133] Fix | Delete
* the user and must be freed explicitly with `git_tree_entry_free()`.
[134] Fix | Delete
*
[135] Fix | Delete
* @param out Pointer where to store the tree entry
[136] Fix | Delete
* @param root Previously loaded tree which is the root of the relative path
[137] Fix | Delete
* @param path Path to the contained entry
[138] Fix | Delete
* @return 0 on success; GIT_ENOTFOUND if the path does not exist
[139] Fix | Delete
*/
[140] Fix | Delete
GIT_EXTERN(int) git_tree_entry_bypath(
[141] Fix | Delete
git_tree_entry **out,
[142] Fix | Delete
const git_tree *root,
[143] Fix | Delete
const char *path);
[144] Fix | Delete
[145] Fix | Delete
/**
[146] Fix | Delete
* Duplicate a tree entry
[147] Fix | Delete
*
[148] Fix | Delete
* Create a copy of a tree entry. The returned copy is owned by the user,
[149] Fix | Delete
* and must be freed explicitly with `git_tree_entry_free()`.
[150] Fix | Delete
*
[151] Fix | Delete
* @param dest pointer where to store the copy
[152] Fix | Delete
* @param source tree entry to duplicate
[153] Fix | Delete
* @return 0 or an error code
[154] Fix | Delete
*/
[155] Fix | Delete
GIT_EXTERN(int) git_tree_entry_dup(git_tree_entry **dest, const git_tree_entry *source);
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* Free a user-owned tree entry
[159] Fix | Delete
*
[160] Fix | Delete
* IMPORTANT: This function is only needed for tree entries owned by the
[161] Fix | Delete
* user, such as the ones returned by `git_tree_entry_dup()` or
[162] Fix | Delete
* `git_tree_entry_bypath()`.
[163] Fix | Delete
*
[164] Fix | Delete
* @param entry The entry to free
[165] Fix | Delete
*/
[166] Fix | Delete
GIT_EXTERN(void) git_tree_entry_free(git_tree_entry *entry);
[167] Fix | Delete
[168] Fix | Delete
/**
[169] Fix | Delete
* Get the filename of a tree entry
[170] Fix | Delete
*
[171] Fix | Delete
* @param entry a tree entry
[172] Fix | Delete
* @return the name of the file
[173] Fix | Delete
*/
[174] Fix | Delete
GIT_EXTERN(const char *) git_tree_entry_name(const git_tree_entry *entry);
[175] Fix | Delete
[176] Fix | Delete
/**
[177] Fix | Delete
* Get the id of the object pointed by the entry
[178] Fix | Delete
*
[179] Fix | Delete
* @param entry a tree entry
[180] Fix | Delete
* @return the oid of the object
[181] Fix | Delete
*/
[182] Fix | Delete
GIT_EXTERN(const git_oid *) git_tree_entry_id(const git_tree_entry *entry);
[183] Fix | Delete
[184] Fix | Delete
/**
[185] Fix | Delete
* Get the type of the object pointed by the entry
[186] Fix | Delete
*
[187] Fix | Delete
* @param entry a tree entry
[188] Fix | Delete
* @return the type of the pointed object
[189] Fix | Delete
*/
[190] Fix | Delete
GIT_EXTERN(git_object_t) git_tree_entry_type(const git_tree_entry *entry);
[191] Fix | Delete
[192] Fix | Delete
/**
[193] Fix | Delete
* Get the UNIX file attributes of a tree entry
[194] Fix | Delete
*
[195] Fix | Delete
* @param entry a tree entry
[196] Fix | Delete
* @return filemode as an integer
[197] Fix | Delete
*/
[198] Fix | Delete
GIT_EXTERN(git_filemode_t) git_tree_entry_filemode(const git_tree_entry *entry);
[199] Fix | Delete
[200] Fix | Delete
/**
[201] Fix | Delete
* Get the raw UNIX file attributes of a tree entry
[202] Fix | Delete
*
[203] Fix | Delete
* This function does not perform any normalization and is only useful
[204] Fix | Delete
* if you need to be able to recreate the original tree object.
[205] Fix | Delete
*
[206] Fix | Delete
* @param entry a tree entry
[207] Fix | Delete
* @return filemode as an integer
[208] Fix | Delete
*/
[209] Fix | Delete
[210] Fix | Delete
GIT_EXTERN(git_filemode_t) git_tree_entry_filemode_raw(const git_tree_entry *entry);
[211] Fix | Delete
/**
[212] Fix | Delete
* Compare two tree entries
[213] Fix | Delete
*
[214] Fix | Delete
* @param e1 first tree entry
[215] Fix | Delete
* @param e2 second tree entry
[216] Fix | Delete
* @return <0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2
[217] Fix | Delete
*/
[218] Fix | Delete
GIT_EXTERN(int) git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entry *e2);
[219] Fix | Delete
[220] Fix | Delete
/**
[221] Fix | Delete
* Convert a tree entry to the git_object it points to.
[222] Fix | Delete
*
[223] Fix | Delete
* You must call `git_object_free()` on the object when you are done with it.
[224] Fix | Delete
*
[225] Fix | Delete
* @param object_out pointer to the converted object
[226] Fix | Delete
* @param repo repository where to lookup the pointed object
[227] Fix | Delete
* @param entry a tree entry
[228] Fix | Delete
* @return 0 or an error code
[229] Fix | Delete
*/
[230] Fix | Delete
GIT_EXTERN(int) git_tree_entry_to_object(
[231] Fix | Delete
git_object **object_out,
[232] Fix | Delete
git_repository *repo,
[233] Fix | Delete
const git_tree_entry *entry);
[234] Fix | Delete
[235] Fix | Delete
/**
[236] Fix | Delete
* Create a new tree builder.
[237] Fix | Delete
*
[238] Fix | Delete
* The tree builder can be used to create or modify trees in memory and
[239] Fix | Delete
* write them as tree objects to the database.
[240] Fix | Delete
*
[241] Fix | Delete
* If the `source` parameter is not NULL, the tree builder will be
[242] Fix | Delete
* initialized with the entries of the given tree.
[243] Fix | Delete
*
[244] Fix | Delete
* If the `source` parameter is NULL, the tree builder will start with no
[245] Fix | Delete
* entries and will have to be filled manually.
[246] Fix | Delete
*
[247] Fix | Delete
* @param out Pointer where to store the tree builder
[248] Fix | Delete
* @param repo Repository in which to store the object
[249] Fix | Delete
* @param source Source tree to initialize the builder (optional)
[250] Fix | Delete
* @return 0 on success; error code otherwise
[251] Fix | Delete
*/
[252] Fix | Delete
GIT_EXTERN(int) git_treebuilder_new(
[253] Fix | Delete
git_treebuilder **out, git_repository *repo, const git_tree *source);
[254] Fix | Delete
[255] Fix | Delete
/**
[256] Fix | Delete
* Clear all the entires in the builder
[257] Fix | Delete
*
[258] Fix | Delete
* @param bld Builder to clear
[259] Fix | Delete
* @return 0 on success; error code otherwise
[260] Fix | Delete
*/
[261] Fix | Delete
GIT_EXTERN(int) git_treebuilder_clear(git_treebuilder *bld);
[262] Fix | Delete
[263] Fix | Delete
/**
[264] Fix | Delete
* Get the number of entries listed in a treebuilder
[265] Fix | Delete
*
[266] Fix | Delete
* @param bld a previously loaded treebuilder.
[267] Fix | Delete
* @return the number of entries in the treebuilder
[268] Fix | Delete
*/
[269] Fix | Delete
GIT_EXTERN(size_t) git_treebuilder_entrycount(git_treebuilder *bld);
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* Free a tree builder
[273] Fix | Delete
*
[274] Fix | Delete
* This will clear all the entries and free to builder.
[275] Fix | Delete
* Failing to free the builder after you're done using it
[276] Fix | Delete
* will result in a memory leak
[277] Fix | Delete
*
[278] Fix | Delete
* @param bld Builder to free
[279] Fix | Delete
*/
[280] Fix | Delete
GIT_EXTERN(void) git_treebuilder_free(git_treebuilder *bld);
[281] Fix | Delete
[282] Fix | Delete
/**
[283] Fix | Delete
* Get an entry from the builder from its filename
[284] Fix | Delete
*
[285] Fix | Delete
* The returned entry is owned by the builder and should
[286] Fix | Delete
* not be freed manually.
[287] Fix | Delete
*
[288] Fix | Delete
* @param bld Tree builder
[289] Fix | Delete
* @param filename Name of the entry
[290] Fix | Delete
* @return pointer to the entry; NULL if not found
[291] Fix | Delete
*/
[292] Fix | Delete
GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(
[293] Fix | Delete
git_treebuilder *bld, const char *filename);
[294] Fix | Delete
[295] Fix | Delete
/**
[296] Fix | Delete
* Add or update an entry to the builder
[297] Fix | Delete
*
[298] Fix | Delete
* Insert a new entry for `filename` in the builder with the
[299] Fix | Delete
* given attributes.
[300] Fix | Delete
*
[301] Fix | Delete
* If an entry named `filename` already exists, its attributes
[302] Fix | Delete
* will be updated with the given ones.
[303] Fix | Delete
*
[304] Fix | Delete
* The optional pointer `out` can be used to retrieve a pointer to the
[305] Fix | Delete
* newly created/updated entry. Pass NULL if you do not need it. The
[306] Fix | Delete
* pointer may not be valid past the next operation in this
[307] Fix | Delete
* builder. Duplicate the entry if you want to keep it.
[308] Fix | Delete
*
[309] Fix | Delete
* By default the entry that you are inserting will be checked for
[310] Fix | Delete
* validity; that it exists in the object database and is of the
[311] Fix | Delete
* correct type. If you do not want this behavior, set the
[312] Fix | Delete
* `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` library option to false.
[313] Fix | Delete
*
[314] Fix | Delete
* @param out Pointer to store the entry (optional)
[315] Fix | Delete
* @param bld Tree builder
[316] Fix | Delete
* @param filename Filename of the entry
[317] Fix | Delete
* @param id SHA1 oid of the entry
[318] Fix | Delete
* @param filemode Folder attributes of the entry. This parameter must
[319] Fix | Delete
* be valued with one of the following entries: 0040000, 0100644,
[320] Fix | Delete
* 0100755, 0120000 or 0160000.
[321] Fix | Delete
* @return 0 or an error code
[322] Fix | Delete
*/
[323] Fix | Delete
GIT_EXTERN(int) git_treebuilder_insert(
[324] Fix | Delete
const git_tree_entry **out,
[325] Fix | Delete
git_treebuilder *bld,
[326] Fix | Delete
const char *filename,
[327] Fix | Delete
const git_oid *id,
[328] Fix | Delete
git_filemode_t filemode);
[329] Fix | Delete
[330] Fix | Delete
/**
[331] Fix | Delete
* Remove an entry from the builder by its filename
[332] Fix | Delete
*
[333] Fix | Delete
* @param bld Tree builder
[334] Fix | Delete
* @param filename Filename of the entry to remove
[335] Fix | Delete
*/
[336] Fix | Delete
GIT_EXTERN(int) git_treebuilder_remove(
[337] Fix | Delete
git_treebuilder *bld, const char *filename);
[338] Fix | Delete
[339] Fix | Delete
/**
[340] Fix | Delete
* Callback for git_treebuilder_filter
[341] Fix | Delete
*
[342] Fix | Delete
* The return value is treated as a boolean, with zero indicating that the
[343] Fix | Delete
* entry should be left alone and any non-zero value meaning that the
[344] Fix | Delete
* entry should be removed from the treebuilder list (i.e. filtered out).
[345] Fix | Delete
*/
[346] Fix | Delete
typedef int GIT_CALLBACK(git_treebuilder_filter_cb)(
[347] Fix | Delete
const git_tree_entry *entry, void *payload);
[348] Fix | Delete
[349] Fix | Delete
/**
[350] Fix | Delete
* Selectively remove entries in the tree
[351] Fix | Delete
*
[352] Fix | Delete
* The `filter` callback will be called for each entry in the tree with a
[353] Fix | Delete
* pointer to the entry and the provided `payload`; if the callback returns
[354] Fix | Delete
* non-zero, the entry will be filtered (removed from the builder).
[355] Fix | Delete
*
[356] Fix | Delete
* @param bld Tree builder
[357] Fix | Delete
* @param filter Callback to filter entries
[358] Fix | Delete
* @param payload Extra data to pass to filter callback
[359] Fix | Delete
* @return 0 on success, non-zero callback return value, or error code
[360] Fix | Delete
*/
[361] Fix | Delete
GIT_EXTERN(int) git_treebuilder_filter(
[362] Fix | Delete
git_treebuilder *bld,
[363] Fix | Delete
git_treebuilder_filter_cb filter,
[364] Fix | Delete
void *payload);
[365] Fix | Delete
[366] Fix | Delete
/**
[367] Fix | Delete
* Write the contents of the tree builder as a tree object
[368] Fix | Delete
*
[369] Fix | Delete
* The tree builder will be written to the given `repo`, and its
[370] Fix | Delete
* identifying SHA1 hash will be stored in the `id` pointer.
[371] Fix | Delete
*
[372] Fix | Delete
* @param id Pointer to store the OID of the newly written tree
[373] Fix | Delete
* @param bld Tree builder to write
[374] Fix | Delete
* @return 0 or an error code
[375] Fix | Delete
*/
[376] Fix | Delete
GIT_EXTERN(int) git_treebuilder_write(
[377] Fix | Delete
git_oid *id, git_treebuilder *bld);
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
* Write the contents of the tree builder as a tree object
[381] Fix | Delete
* using a shared git_buf.
[382] Fix | Delete
*
[383] Fix | Delete
* @see git_treebuilder_write
[384] Fix | Delete
*
[385] Fix | Delete
* @param oid Pointer to store the OID of the newly written tree
[386] Fix | Delete
* @param bld Tree builder to write
[387] Fix | Delete
* @param tree Shared buffer for writing the tree. Will be grown as necessary.
[388] Fix | Delete
* @return 0 or an error code
[389] Fix | Delete
*/
[390] Fix | Delete
GIT_EXTERN(int) git_treebuilder_write_with_buffer(
[391] Fix | Delete
git_oid *oid, git_treebuilder *bld, git_buf *tree);
[392] Fix | Delete
[393] Fix | Delete
/** Callback for the tree traversal method */
[394] Fix | Delete
typedef int GIT_CALLBACK(git_treewalk_cb)(
[395] Fix | Delete
const char *root, const git_tree_entry *entry, void *payload);
[396] Fix | Delete
[397] Fix | Delete
/** Tree traversal modes */
[398] Fix | Delete
typedef enum {
[399] Fix | Delete
GIT_TREEWALK_PRE = 0, /* Pre-order */
[400] Fix | Delete
GIT_TREEWALK_POST = 1, /* Post-order */
[401] Fix | Delete
} git_treewalk_mode;
[402] Fix | Delete
[403] Fix | Delete
/**
[404] Fix | Delete
* Traverse the entries in a tree and its subtrees in post or pre order.
[405] Fix | Delete
*
[406] Fix | Delete
* The entries will be traversed in the specified order, children subtrees
[407] Fix | Delete
* will be automatically loaded as required, and the `callback` will be
[408] Fix | Delete
* called once per entry with the current (relative) root for the entry and
[409] Fix | Delete
* the entry data itself.
[410] Fix | Delete
*
[411] Fix | Delete
* If the callback returns a positive value, the passed entry will be
[412] Fix | Delete
* skipped on the traversal (in pre mode). A negative value stops the walk.
[413] Fix | Delete
*
[414] Fix | Delete
* @param tree The tree to walk
[415] Fix | Delete
* @param mode Traversal mode (pre or post-order)
[416] Fix | Delete
* @param callback Function to call on each tree entry
[417] Fix | Delete
* @param payload Opaque pointer to be passed on each callback
[418] Fix | Delete
* @return 0 or an error code
[419] Fix | Delete
*/
[420] Fix | Delete
GIT_EXTERN(int) git_tree_walk(
[421] Fix | Delete
const git_tree *tree,
[422] Fix | Delete
git_treewalk_mode mode,
[423] Fix | Delete
git_treewalk_cb callback,
[424] Fix | Delete
void *payload);
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* Create an in-memory copy of a tree. The copy must be explicitly
[428] Fix | Delete
* free'd or it will leak.
[429] Fix | Delete
*
[430] Fix | Delete
* @param out Pointer to store the copy of the tree
[431] Fix | Delete
* @param source Original tree to copy
[432] Fix | Delete
*/
[433] Fix | Delete
GIT_EXTERN(int) git_tree_dup(git_tree **out, git_tree *source);
[434] Fix | Delete
[435] Fix | Delete
/**
[436] Fix | Delete
* The kind of update to perform
[437] Fix | Delete
*/
[438] Fix | Delete
typedef enum {
[439] Fix | Delete
/** Update or insert an entry at the specified path */
[440] Fix | Delete
GIT_TREE_UPDATE_UPSERT,
[441] Fix | Delete
/** Remove an entry from the specified path */
[442] Fix | Delete
GIT_TREE_UPDATE_REMOVE,
[443] Fix | Delete
} git_tree_update_t;
[444] Fix | Delete
[445] Fix | Delete
/**
[446] Fix | Delete
* An action to perform during the update of a tree
[447] Fix | Delete
*/
[448] Fix | Delete
typedef struct {
[449] Fix | Delete
/** Update action. If it's an removal, only the path is looked at */
[450] Fix | Delete
git_tree_update_t action;
[451] Fix | Delete
/** The entry's id */
[452] Fix | Delete
git_oid id;
[453] Fix | Delete
/** The filemode/kind of object */
[454] Fix | Delete
git_filemode_t filemode;
[455] Fix | Delete
/** The full path from the root tree */
[456] Fix | Delete
const char *path;
[457] Fix | Delete
} git_tree_update;
[458] Fix | Delete
[459] Fix | Delete
/**
[460] Fix | Delete
* Create a tree based on another one with the specified modifications
[461] Fix | Delete
*
[462] Fix | Delete
* Given the `baseline` perform the changes described in the list of
[463] Fix | Delete
* `updates` and create a new tree.
[464] Fix | Delete
*
[465] Fix | Delete
* This function is optimized for common file/directory addition, removal and
[466] Fix | Delete
* replacement in trees. It is much more efficient than reading the tree into a
[467] Fix | Delete
* `git_index` and modifying that, but in exchange it is not as flexible.
[468] Fix | Delete
*
[469] Fix | Delete
* Deleting and adding the same entry is undefined behaviour, changing
[470] Fix | Delete
* a tree to a blob or viceversa is not supported.
[471] Fix | Delete
*
[472] Fix | Delete
* @param out id of the new tree
[473] Fix | Delete
* @param repo the repository in which to create the tree, must be the
[474] Fix | Delete
* same as for `baseline`
[475] Fix | Delete
* @param baseline the tree to base these changes on
[476] Fix | Delete
* @param nupdates the number of elements in the update list
[477] Fix | Delete
* @param updates the list of updates to perform
[478] Fix | Delete
*/
[479] Fix | Delete
GIT_EXTERN(int) git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates);
[480] Fix | Delete
[481] Fix | Delete
/** @} */
[482] Fix | Delete
[483] Fix | Delete
GIT_END_DECL
[484] Fix | Delete
#endif
[485] Fix | Delete
[486] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function