1 /*
2  * Copyright (C) the libgit2 contributors. All rights reserved.
3  *
4  * This file is part of libgit2, distributed under the GNU GPL v2 with
5  * a Linking Exception. For full terms see the included COPYING file.
6  */
7 module libgit2_d.sys.commit;
8 
9 
10 private static import libgit2_d.oid;
11 private static import libgit2_d.types;
12 
13 /**
14  * @file git2/sys/commit.h
15  * @brief Low-level Git commit creation
16  * @defgroup git_backend Git custom backend APIs
17  * @ingroup Git
18  * @{
19  */
20 extern (C):
21 nothrow @nogc:
22 package(libgit2_d):
23 
24 /**
25  * Create new commit in the repository from a list of `git_oid` values.
26  *
27  * See documentation for `git_commit_create()` for information about the
28  * parameters, as the meaning is identical excepting that `tree` and
29  * `parents` now take `git_oid`.  This is a dangerous API in that nor
30  * the `tree`, neither the `parents` list of `git_oid`s are checked for
31  * validity.
32  *
33  * @see git_commit_create
34  */
35 //GIT_EXTERN
36 int git_commit_create_from_ids(libgit2_d.oid.git_oid* id, libgit2_d.types.git_repository* repo, const (char)* update_ref, const (libgit2_d.types.git_signature)* author, const (libgit2_d.types.git_signature)* committer, const (char)* message_encoding, const (char)* message, const (libgit2_d.oid.git_oid)* tree, size_t parent_count, const (libgit2_d.oid.git_oid)** parents);
37 
38 /**
39  * Callback function to return parents for commit.
40  *
41  * This is invoked with the count of the number of parents processed so far
42  * along with the user supplied payload.  This should return a git_oid of
43  * the next parent or null if all parents have been provided.
44  */
45 alias git_commit_parent_callback = const (libgit2_d.oid.git_oid)* function(size_t idx, void* payload);
46 
47 /**
48  * Create a new commit in the repository with an callback to supply parents.
49  *
50  * See documentation for `git_commit_create()` for information about the
51  * parameters, as the meaning is identical excepting that `tree` takes a
52  * `git_oid` and doesn't check for validity, and `parent_cb` is invoked
53  * with `parent_payload` and should return `git_oid` values or null to
54  * indicate that all parents are accounted for.
55  *
56  * @see git_commit_create
57  */
58 //GIT_EXTERN
59 int git_commit_create_from_callback(libgit2_d.oid.git_oid* id, libgit2_d.types.git_repository* repo, const (char)* update_ref, const (libgit2_d.types.git_signature)* author, const (libgit2_d.types.git_signature)* committer, const (char)* message_encoding, const (char)* message, const (libgit2_d.oid.git_oid)* tree, .git_commit_parent_callback parent_cb, void* parent_payload);
60 
61 /** @} */