Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:36

0001 /*
0002  * Copyright (C) the libgit2 contributors. All rights reserved.
0003  *
0004  * This file is part of libgit2, distributed under the GNU GPL v2 with
0005  * a Linking Exception. For full terms see the included COPYING file.
0006  */
0007 #ifndef INCLUDE_sys_git_commit_h__
0008 #define INCLUDE_sys_git_commit_h__
0009 
0010 #include "git2/common.h"
0011 #include "git2/types.h"
0012 #include "git2/oid.h"
0013 
0014 /**
0015  * @file git2/sys/commit.h
0016  * @brief Low-level Git commit creation
0017  * @defgroup git_backend Git custom backend APIs
0018  * @ingroup Git
0019  * @{
0020  */
0021 GIT_BEGIN_DECL
0022 
0023 /**
0024  * Create new commit in the repository from a list of `git_oid` values.
0025  *
0026  * See documentation for `git_commit_create()` for information about the
0027  * parameters, as the meaning is identical excepting that `tree` and
0028  * `parents` now take `git_oid`.  This is a dangerous API in that nor
0029  * the `tree`, neither the `parents` list of `git_oid`s are checked for
0030  * validity.
0031  *
0032  * @see git_commit_create
0033  */
0034 GIT_EXTERN(int) git_commit_create_from_ids(
0035     git_oid *id,
0036     git_repository *repo,
0037     const char *update_ref,
0038     const git_signature *author,
0039     const git_signature *committer,
0040     const char *message_encoding,
0041     const char *message,
0042     const git_oid *tree,
0043     size_t parent_count,
0044     const git_oid *parents[]);
0045 
0046 /**
0047  * Callback function to return parents for commit.
0048  *
0049  * This is invoked with the count of the number of parents processed so far
0050  * along with the user supplied payload.  This should return a git_oid of
0051  * the next parent or NULL if all parents have been provided.
0052  */
0053 typedef const git_oid * GIT_CALLBACK(git_commit_parent_callback)(size_t idx, void *payload);
0054 
0055 /**
0056  * Create a new commit in the repository with an callback to supply parents.
0057  *
0058  * See documentation for `git_commit_create()` for information about the
0059  * parameters, as the meaning is identical excepting that `tree` takes a
0060  * `git_oid` and doesn't check for validity, and `parent_cb` is invoked
0061  * with `parent_payload` and should return `git_oid` values or NULL to
0062  * indicate that all parents are accounted for.
0063  *
0064  * @see git_commit_create
0065  */
0066 GIT_EXTERN(int) git_commit_create_from_callback(
0067     git_oid *id,
0068     git_repository *repo,
0069     const char *update_ref,
0070     const git_signature *author,
0071     const git_signature *committer,
0072     const char *message_encoding,
0073     const char *message,
0074     const git_oid *tree,
0075     git_commit_parent_callback parent_cb,
0076     void *parent_payload);
0077 
0078 /** @} */
0079 GIT_END_DECL
0080 #endif