Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: commit.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_commit_h__
[6] Fix | Delete
#define INCLUDE_git_commit_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/commit.h
[15] Fix | Delete
* @brief Git commit parsing, formatting routines
[16] Fix | Delete
* @defgroup git_commit Git commit parsing, formatting 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 commit object from a repository.
[24] Fix | Delete
*
[25] Fix | Delete
* The returned object should be released with `git_commit_free` when no
[26] Fix | Delete
* longer needed.
[27] Fix | Delete
*
[28] Fix | Delete
* @param commit pointer to the looked up commit
[29] Fix | Delete
* @param repo the repo to use when locating the commit.
[30] Fix | Delete
* @param id identity of the commit to locate. If the object is
[31] Fix | Delete
* an annotated tag it will be peeled back to the commit.
[32] Fix | Delete
* @return 0 or an error code
[33] Fix | Delete
*/
[34] Fix | Delete
GIT_EXTERN(int) git_commit_lookup(
[35] Fix | Delete
git_commit **commit, git_repository *repo, const git_oid *id);
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Lookup a commit object from a repository, given a prefix of its
[39] Fix | Delete
* identifier (short id).
[40] Fix | Delete
*
[41] Fix | Delete
* The returned object should be released with `git_commit_free` when no
[42] Fix | Delete
* longer needed.
[43] Fix | Delete
*
[44] Fix | Delete
* @see git_object_lookup_prefix
[45] Fix | Delete
*
[46] Fix | Delete
* @param commit pointer to the looked up commit
[47] Fix | Delete
* @param repo the repo to use when locating the commit.
[48] Fix | Delete
* @param id identity of the commit to locate. If the object is
[49] Fix | Delete
* an annotated tag it will be peeled back to the commit.
[50] Fix | Delete
* @param len the length of the short identifier
[51] Fix | Delete
* @return 0 or an error code
[52] Fix | Delete
*/
[53] Fix | Delete
GIT_EXTERN(int) git_commit_lookup_prefix(
[54] Fix | Delete
git_commit **commit, git_repository *repo, const git_oid *id, size_t len);
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Close an open commit
[58] Fix | Delete
*
[59] Fix | Delete
* This is a wrapper around git_object_free()
[60] Fix | Delete
*
[61] Fix | Delete
* IMPORTANT:
[62] Fix | Delete
* It *is* necessary to call this method when you stop
[63] Fix | Delete
* using a commit. Failure to do so will cause a memory leak.
[64] Fix | Delete
*
[65] Fix | Delete
* @param commit the commit to close
[66] Fix | Delete
*/
[67] Fix | Delete
[68] Fix | Delete
GIT_EXTERN(void) git_commit_free(git_commit *commit);
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Get the id of a commit.
[72] Fix | Delete
*
[73] Fix | Delete
* @param commit a previously loaded commit.
[74] Fix | Delete
* @return object identity for the commit.
[75] Fix | Delete
*/
[76] Fix | Delete
GIT_EXTERN(const git_oid *) git_commit_id(const git_commit *commit);
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Get the repository that contains the commit.
[80] Fix | Delete
*
[81] Fix | Delete
* @param commit A previously loaded commit.
[82] Fix | Delete
* @return Repository that contains this commit.
[83] Fix | Delete
*/
[84] Fix | Delete
GIT_EXTERN(git_repository *) git_commit_owner(const git_commit *commit);
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Get the encoding for the message of a commit,
[88] Fix | Delete
* as a string representing a standard encoding name.
[89] Fix | Delete
*
[90] Fix | Delete
* The encoding may be NULL if the `encoding` header
[91] Fix | Delete
* in the commit is missing; in that case UTF-8 is assumed.
[92] Fix | Delete
*
[93] Fix | Delete
* @param commit a previously loaded commit.
[94] Fix | Delete
* @return NULL, or the encoding
[95] Fix | Delete
*/
[96] Fix | Delete
GIT_EXTERN(const char *) git_commit_message_encoding(const git_commit *commit);
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* Get the full message of a commit.
[100] Fix | Delete
*
[101] Fix | Delete
* The returned message will be slightly prettified by removing any
[102] Fix | Delete
* potential leading newlines.
[103] Fix | Delete
*
[104] Fix | Delete
* @param commit a previously loaded commit.
[105] Fix | Delete
* @return the message of a commit
[106] Fix | Delete
*/
[107] Fix | Delete
GIT_EXTERN(const char *) git_commit_message(const git_commit *commit);
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Get the full raw message of a commit.
[111] Fix | Delete
*
[112] Fix | Delete
* @param commit a previously loaded commit.
[113] Fix | Delete
* @return the raw message of a commit
[114] Fix | Delete
*/
[115] Fix | Delete
GIT_EXTERN(const char *) git_commit_message_raw(const git_commit *commit);
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Get the short "summary" of the git commit message.
[119] Fix | Delete
*
[120] Fix | Delete
* The returned message is the summary of the commit, comprising the
[121] Fix | Delete
* first paragraph of the message with whitespace trimmed and squashed.
[122] Fix | Delete
*
[123] Fix | Delete
* @param commit a previously loaded commit.
[124] Fix | Delete
* @return the summary of a commit or NULL on error
[125] Fix | Delete
*/
[126] Fix | Delete
GIT_EXTERN(const char *) git_commit_summary(git_commit *commit);
[127] Fix | Delete
[128] Fix | Delete
/**
[129] Fix | Delete
* Get the long "body" of the git commit message.
[130] Fix | Delete
*
[131] Fix | Delete
* The returned message is the body of the commit, comprising
[132] Fix | Delete
* everything but the first paragraph of the message. Leading and
[133] Fix | Delete
* trailing whitespaces are trimmed.
[134] Fix | Delete
*
[135] Fix | Delete
* @param commit a previously loaded commit.
[136] Fix | Delete
* @return the body of a commit or NULL when no the message only
[137] Fix | Delete
* consists of a summary
[138] Fix | Delete
*/
[139] Fix | Delete
GIT_EXTERN(const char *) git_commit_body(git_commit *commit);
[140] Fix | Delete
[141] Fix | Delete
/**
[142] Fix | Delete
* Get the commit time (i.e. committer time) of a commit.
[143] Fix | Delete
*
[144] Fix | Delete
* @param commit a previously loaded commit.
[145] Fix | Delete
* @return the time of a commit
[146] Fix | Delete
*/
[147] Fix | Delete
GIT_EXTERN(git_time_t) git_commit_time(const git_commit *commit);
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.
[151] Fix | Delete
*
[152] Fix | Delete
* @param commit a previously loaded commit.
[153] Fix | Delete
* @return positive or negative timezone offset, in minutes from UTC
[154] Fix | Delete
*/
[155] Fix | Delete
GIT_EXTERN(int) git_commit_time_offset(const git_commit *commit);
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* Get the committer of a commit.
[159] Fix | Delete
*
[160] Fix | Delete
* @param commit a previously loaded commit.
[161] Fix | Delete
* @return the committer of a commit
[162] Fix | Delete
*/
[163] Fix | Delete
GIT_EXTERN(const git_signature *) git_commit_committer(const git_commit *commit);
[164] Fix | Delete
[165] Fix | Delete
/**
[166] Fix | Delete
* Get the author of a commit.
[167] Fix | Delete
*
[168] Fix | Delete
* @param commit a previously loaded commit.
[169] Fix | Delete
* @return the author of a commit
[170] Fix | Delete
*/
[171] Fix | Delete
GIT_EXTERN(const git_signature *) git_commit_author(const git_commit *commit);
[172] Fix | Delete
[173] Fix | Delete
/**
[174] Fix | Delete
* Get the committer of a commit, using the mailmap to map names and email
[175] Fix | Delete
* addresses to canonical real names and email addresses.
[176] Fix | Delete
*
[177] Fix | Delete
* Call `git_signature_free` to free the signature.
[178] Fix | Delete
*
[179] Fix | Delete
* @param out a pointer to store the resolved signature.
[180] Fix | Delete
* @param commit a previously loaded commit.
[181] Fix | Delete
* @param mailmap the mailmap to resolve with. (may be NULL)
[182] Fix | Delete
* @return 0 or an error code
[183] Fix | Delete
*/
[184] Fix | Delete
GIT_EXTERN(int) git_commit_committer_with_mailmap(
[185] Fix | Delete
git_signature **out, const git_commit *commit, const git_mailmap *mailmap);
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* Get the author of a commit, using the mailmap to map names and email
[189] Fix | Delete
* addresses to canonical real names and email addresses.
[190] Fix | Delete
*
[191] Fix | Delete
* Call `git_signature_free` to free the signature.
[192] Fix | Delete
*
[193] Fix | Delete
* @param out a pointer to store the resolved signature.
[194] Fix | Delete
* @param commit a previously loaded commit.
[195] Fix | Delete
* @param mailmap the mailmap to resolve with. (may be NULL)
[196] Fix | Delete
* @return 0 or an error code
[197] Fix | Delete
*/
[198] Fix | Delete
GIT_EXTERN(int) git_commit_author_with_mailmap(
[199] Fix | Delete
git_signature **out, const git_commit *commit, const git_mailmap *mailmap);
[200] Fix | Delete
[201] Fix | Delete
/**
[202] Fix | Delete
* Get the full raw text of the commit header.
[203] Fix | Delete
*
[204] Fix | Delete
* @param commit a previously loaded commit
[205] Fix | Delete
* @return the header text of the commit
[206] Fix | Delete
*/
[207] Fix | Delete
GIT_EXTERN(const char *) git_commit_raw_header(const git_commit *commit);
[208] Fix | Delete
[209] Fix | Delete
/**
[210] Fix | Delete
* Get the tree pointed to by a commit.
[211] Fix | Delete
*
[212] Fix | Delete
* @param tree_out pointer where to store the tree object
[213] Fix | Delete
* @param commit a previously loaded commit.
[214] Fix | Delete
* @return 0 or an error code
[215] Fix | Delete
*/
[216] Fix | Delete
GIT_EXTERN(int) git_commit_tree(git_tree **tree_out, const git_commit *commit);
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Get the id of the tree pointed to by a commit. This differs from
[220] Fix | Delete
* `git_commit_tree` in that no attempts are made to fetch an object
[221] Fix | Delete
* from the ODB.
[222] Fix | Delete
*
[223] Fix | Delete
* @param commit a previously loaded commit.
[224] Fix | Delete
* @return the id of tree pointed to by commit.
[225] Fix | Delete
*/
[226] Fix | Delete
GIT_EXTERN(const git_oid *) git_commit_tree_id(const git_commit *commit);
[227] Fix | Delete
[228] Fix | Delete
/**
[229] Fix | Delete
* Get the number of parents of this commit
[230] Fix | Delete
*
[231] Fix | Delete
* @param commit a previously loaded commit.
[232] Fix | Delete
* @return integer of count of parents
[233] Fix | Delete
*/
[234] Fix | Delete
GIT_EXTERN(unsigned int) git_commit_parentcount(const git_commit *commit);
[235] Fix | Delete
[236] Fix | Delete
/**
[237] Fix | Delete
* Get the specified parent of the commit.
[238] Fix | Delete
*
[239] Fix | Delete
* @param out Pointer where to store the parent commit
[240] Fix | Delete
* @param commit a previously loaded commit.
[241] Fix | Delete
* @param n the position of the parent (from 0 to `parentcount`)
[242] Fix | Delete
* @return 0 or an error code
[243] Fix | Delete
*/
[244] Fix | Delete
GIT_EXTERN(int) git_commit_parent(
[245] Fix | Delete
git_commit **out,
[246] Fix | Delete
const git_commit *commit,
[247] Fix | Delete
unsigned int n);
[248] Fix | Delete
[249] Fix | Delete
/**
[250] Fix | Delete
* Get the oid of a specified parent for a commit. This is different from
[251] Fix | Delete
* `git_commit_parent`, which will attempt to load the parent commit from
[252] Fix | Delete
* the ODB.
[253] Fix | Delete
*
[254] Fix | Delete
* @param commit a previously loaded commit.
[255] Fix | Delete
* @param n the position of the parent (from 0 to `parentcount`)
[256] Fix | Delete
* @return the id of the parent, NULL on error.
[257] Fix | Delete
*/
[258] Fix | Delete
GIT_EXTERN(const git_oid *) git_commit_parent_id(
[259] Fix | Delete
const git_commit *commit,
[260] Fix | Delete
unsigned int n);
[261] Fix | Delete
[262] Fix | Delete
/**
[263] Fix | Delete
* Get the commit object that is the <n>th generation ancestor
[264] Fix | Delete
* of the named commit object, following only the first parents.
[265] Fix | Delete
* The returned commit has to be freed by the caller.
[266] Fix | Delete
*
[267] Fix | Delete
* Passing `0` as the generation number returns another instance of the
[268] Fix | Delete
* base commit itself.
[269] Fix | Delete
*
[270] Fix | Delete
* @param ancestor Pointer where to store the ancestor commit
[271] Fix | Delete
* @param commit a previously loaded commit.
[272] Fix | Delete
* @param n the requested generation
[273] Fix | Delete
* @return 0 on success; GIT_ENOTFOUND if no matching ancestor exists
[274] Fix | Delete
* or an error code
[275] Fix | Delete
*/
[276] Fix | Delete
GIT_EXTERN(int) git_commit_nth_gen_ancestor(
[277] Fix | Delete
git_commit **ancestor,
[278] Fix | Delete
const git_commit *commit,
[279] Fix | Delete
unsigned int n);
[280] Fix | Delete
[281] Fix | Delete
/**
[282] Fix | Delete
* Get an arbitrary header field
[283] Fix | Delete
*
[284] Fix | Delete
* @param out the buffer to fill; existing content will be
[285] Fix | Delete
* overwritten
[286] Fix | Delete
* @param commit the commit to look in
[287] Fix | Delete
* @param field the header field to return
[288] Fix | Delete
* @return 0 on succeess, GIT_ENOTFOUND if the field does not exist,
[289] Fix | Delete
* or an error code
[290] Fix | Delete
*/
[291] Fix | Delete
GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field);
[292] Fix | Delete
[293] Fix | Delete
/**
[294] Fix | Delete
* Extract the signature from a commit
[295] Fix | Delete
*
[296] Fix | Delete
* If the id is not for a commit, the error class will be
[297] Fix | Delete
* `GIT_ERROR_INVALID`. If the commit does not have a signature, the
[298] Fix | Delete
* error class will be `GIT_ERROR_OBJECT`.
[299] Fix | Delete
*
[300] Fix | Delete
* @param signature the signature block; existing content will be
[301] Fix | Delete
* overwritten
[302] Fix | Delete
* @param signed_data signed data; this is the commit contents minus the signature block;
[303] Fix | Delete
* existing content will be overwritten
[304] Fix | Delete
* @param repo the repository in which the commit exists
[305] Fix | Delete
* @param commit_id the commit from which to extract the data
[306] Fix | Delete
* @param field the name of the header field containing the signature
[307] Fix | Delete
* block; pass `NULL` to extract the default 'gpgsig'
[308] Fix | Delete
* @return 0 on success, GIT_ENOTFOUND if the id is not for a commit
[309] Fix | Delete
* or the commit does not have a signature.
[310] Fix | Delete
*/
[311] Fix | Delete
GIT_EXTERN(int) git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, const char *field);
[312] Fix | Delete
[313] Fix | Delete
/**
[314] Fix | Delete
* Create new commit in the repository from a list of `git_object` pointers
[315] Fix | Delete
*
[316] Fix | Delete
* The message will **not** be cleaned up automatically. You can do that
[317] Fix | Delete
* with the `git_message_prettify()` function.
[318] Fix | Delete
*
[319] Fix | Delete
* @param id Pointer in which to store the OID of the newly created commit
[320] Fix | Delete
*
[321] Fix | Delete
* @param repo Repository where to store the commit
[322] Fix | Delete
*
[323] Fix | Delete
* @param update_ref If not NULL, name of the reference that
[324] Fix | Delete
* will be updated to point to this commit. If the reference
[325] Fix | Delete
* is not direct, it will be resolved to a direct reference.
[326] Fix | Delete
* Use "HEAD" to update the HEAD of the current branch and
[327] Fix | Delete
* make it point to this commit. If the reference doesn't
[328] Fix | Delete
* exist yet, it will be created. If it does exist, the first
[329] Fix | Delete
* parent must be the tip of this branch.
[330] Fix | Delete
*
[331] Fix | Delete
* @param author Signature with author and author time of commit
[332] Fix | Delete
*
[333] Fix | Delete
* @param committer Signature with committer and * commit time of commit
[334] Fix | Delete
*
[335] Fix | Delete
* @param message_encoding The encoding for the message in the
[336] Fix | Delete
* commit, represented with a standard encoding name.
[337] Fix | Delete
* E.g. "UTF-8". If NULL, no encoding header is written and
[338] Fix | Delete
* UTF-8 is assumed.
[339] Fix | Delete
*
[340] Fix | Delete
* @param message Full message for this commit
[341] Fix | Delete
*
[342] Fix | Delete
* @param tree An instance of a `git_tree` object that will
[343] Fix | Delete
* be used as the tree for the commit. This tree object must
[344] Fix | Delete
* also be owned by the given `repo`.
[345] Fix | Delete
*
[346] Fix | Delete
* @param parent_count Number of parents for this commit
[347] Fix | Delete
*
[348] Fix | Delete
* @param parents Array of `parent_count` pointers to `git_commit`
[349] Fix | Delete
* objects that will be used as the parents for this commit. This
[350] Fix | Delete
* array may be NULL if `parent_count` is 0 (root commit). All the
[351] Fix | Delete
* given commits must be owned by the `repo`.
[352] Fix | Delete
*
[353] Fix | Delete
* @return 0 or an error code
[354] Fix | Delete
* The created commit will be written to the Object Database and
[355] Fix | Delete
* the given reference will be updated to point to it
[356] Fix | Delete
*/
[357] Fix | Delete
GIT_EXTERN(int) git_commit_create(
[358] Fix | Delete
git_oid *id,
[359] Fix | Delete
git_repository *repo,
[360] Fix | Delete
const char *update_ref,
[361] Fix | Delete
const git_signature *author,
[362] Fix | Delete
const git_signature *committer,
[363] Fix | Delete
const char *message_encoding,
[364] Fix | Delete
const char *message,
[365] Fix | Delete
const git_tree *tree,
[366] Fix | Delete
size_t parent_count,
[367] Fix | Delete
const git_commit *parents[]);
[368] Fix | Delete
[369] Fix | Delete
/**
[370] Fix | Delete
* Create new commit in the repository using a variable argument list.
[371] Fix | Delete
*
[372] Fix | Delete
* The message will **not** be cleaned up automatically. You can do that
[373] Fix | Delete
* with the `git_message_prettify()` function.
[374] Fix | Delete
*
[375] Fix | Delete
* The parents for the commit are specified as a variable list of pointers
[376] Fix | Delete
* to `const git_commit *`. Note that this is a convenience method which may
[377] Fix | Delete
* not be safe to export for certain languages or compilers
[378] Fix | Delete
*
[379] Fix | Delete
* All other parameters remain the same as `git_commit_create()`.
[380] Fix | Delete
*
[381] Fix | Delete
* @see git_commit_create
[382] Fix | Delete
*/
[383] Fix | Delete
GIT_EXTERN(int) git_commit_create_v(
[384] Fix | Delete
git_oid *id,
[385] Fix | Delete
git_repository *repo,
[386] Fix | Delete
const char *update_ref,
[387] Fix | Delete
const git_signature *author,
[388] Fix | Delete
const git_signature *committer,
[389] Fix | Delete
const char *message_encoding,
[390] Fix | Delete
const char *message,
[391] Fix | Delete
const git_tree *tree,
[392] Fix | Delete
size_t parent_count,
[393] Fix | Delete
...);
[394] Fix | Delete
[395] Fix | Delete
/**
[396] Fix | Delete
* Amend an existing commit by replacing only non-NULL values.
[397] Fix | Delete
*
[398] Fix | Delete
* This creates a new commit that is exactly the same as the old commit,
[399] Fix | Delete
* except that any non-NULL values will be updated. The new commit has
[400] Fix | Delete
* the same parents as the old commit.
[401] Fix | Delete
*
[402] Fix | Delete
* The `update_ref` value works as in the regular `git_commit_create()`,
[403] Fix | Delete
* updating the ref to point to the newly rewritten commit. If you want
[404] Fix | Delete
* to amend a commit that is not currently the tip of the branch and then
[405] Fix | Delete
* rewrite the following commits to reach a ref, pass this as NULL and
[406] Fix | Delete
* update the rest of the commit chain and ref separately.
[407] Fix | Delete
*
[408] Fix | Delete
* Unlike `git_commit_create()`, the `author`, `committer`, `message`,
[409] Fix | Delete
* `message_encoding`, and `tree` parameters can be NULL in which case this
[410] Fix | Delete
* will use the values from the original `commit_to_amend`.
[411] Fix | Delete
*
[412] Fix | Delete
* All parameters have the same meanings as in `git_commit_create()`.
[413] Fix | Delete
*
[414] Fix | Delete
* @see git_commit_create
[415] Fix | Delete
*/
[416] Fix | Delete
GIT_EXTERN(int) git_commit_amend(
[417] Fix | Delete
git_oid *id,
[418] Fix | Delete
const git_commit *commit_to_amend,
[419] Fix | Delete
const char *update_ref,
[420] Fix | Delete
const git_signature *author,
[421] Fix | Delete
const git_signature *committer,
[422] Fix | Delete
const char *message_encoding,
[423] Fix | Delete
const char *message,
[424] Fix | Delete
const git_tree *tree);
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* Create a commit and write it into a buffer
[428] Fix | Delete
*
[429] Fix | Delete
* Create a commit as with `git_commit_create()` but instead of
[430] Fix | Delete
* writing it to the objectdb, write the contents of the object into a
[431] Fix | Delete
* buffer.
[432] Fix | Delete
*
[433] Fix | Delete
* @param out the buffer into which to write the commit object content
[434] Fix | Delete
*
[435] Fix | Delete
* @param repo Repository where the referenced tree and parents live
[436] Fix | Delete
*
[437] Fix | Delete
* @param author Signature with author and author time of commit
[438] Fix | Delete
*
[439] Fix | Delete
* @param committer Signature with committer and * commit time of commit
[440] Fix | Delete
*
[441] Fix | Delete
* @param message_encoding The encoding for the message in the
[442] Fix | Delete
* commit, represented with a standard encoding name.
[443] Fix | Delete
* E.g. "UTF-8". If NULL, no encoding header is written and
[444] Fix | Delete
* UTF-8 is assumed.
[445] Fix | Delete
*
[446] Fix | Delete
* @param message Full message for this commit
[447] Fix | Delete
*
[448] Fix | Delete
* @param tree An instance of a `git_tree` object that will
[449] Fix | Delete
* be used as the tree for the commit. This tree object must
[450] Fix | Delete
* also be owned by the given `repo`.
[451] Fix | Delete
*
[452] Fix | Delete
* @param parent_count Number of parents for this commit
[453] Fix | Delete
*
[454] Fix | Delete
* @param parents Array of `parent_count` pointers to `git_commit`
[455] Fix | Delete
* objects that will be used as the parents for this commit. This
[456] Fix | Delete
* array may be NULL if `parent_count` is 0 (root commit). All the
[457] Fix | Delete
* given commits must be owned by the `repo`.
[458] Fix | Delete
*
[459] Fix | Delete
* @return 0 or an error code
[460] Fix | Delete
*/
[461] Fix | Delete
GIT_EXTERN(int) git_commit_create_buffer(
[462] Fix | Delete
git_buf *out,
[463] Fix | Delete
git_repository *repo,
[464] Fix | Delete
const git_signature *author,
[465] Fix | Delete
const git_signature *committer,
[466] Fix | Delete
const char *message_encoding,
[467] Fix | Delete
const char *message,
[468] Fix | Delete
const git_tree *tree,
[469] Fix | Delete
size_t parent_count,
[470] Fix | Delete
const git_commit *parents[]);
[471] Fix | Delete
[472] Fix | Delete
/**
[473] Fix | Delete
* Create a commit object from the given buffer and signature
[474] Fix | Delete
*
[475] Fix | Delete
* Given the unsigned commit object's contents, its signature and the
[476] Fix | Delete
* header field in which to store the signature, attach the signature
[477] Fix | Delete
* to the commit and write it into the given repository.
[478] Fix | Delete
*
[479] Fix | Delete
* @param out the resulting commit id
[480] Fix | Delete
* @param commit_content the content of the unsigned commit object
[481] Fix | Delete
* @param signature the signature to add to the commit. Leave `NULL`
[482] Fix | Delete
* to create a commit without adding a signature field.
[483] Fix | Delete
* @param signature_field which header field should contain this
[484] Fix | Delete
* signature. Leave `NULL` for the default of "gpgsig"
[485] Fix | Delete
* @return 0 or an error code
[486] Fix | Delete
*/
[487] Fix | Delete
GIT_EXTERN(int) git_commit_create_with_signature(
[488] Fix | Delete
git_oid *out,
[489] Fix | Delete
git_repository *repo,
[490] Fix | Delete
const char *commit_content,
[491] Fix | Delete
const char *signature,
[492] Fix | Delete
const char *signature_field);
[493] Fix | Delete
[494] Fix | Delete
/**
[495] Fix | Delete
* Create an in-memory copy of a commit. The copy must be explicitly
[496] Fix | Delete
* free'd or it will leak.
[497] Fix | Delete
*
[498] Fix | Delete
* @param out Pointer to store the copy of the commit
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function