summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-06-28 19:15:48 +0200
committerVicent Marti <tanoku@gmail.com>2011-06-28 19:36:27 +0200
commitd5afc0390c3ef919fcde23300d7aefdaeafa5daa (patch)
tree0b661ef8536266c5bf5de645025c8072bc35dc85 /include/git2/commit.h
parent0b10c9ea6ef5d85d862edd044d96561c4fd16e9b (diff)
downloadlibgit2-d5afc0390c3ef919fcde23300d7aefdaeafa5daa.tar.gz
Remove redundant methods from the API
A bunch of redundant methods have been removed from the external API. - All the reference/tag creation methods with `_f` are gone. The force flag is now passed as an argument to the normal create methods. - All the different commit creation methods are gone; commit creation now always requires a `git_commit` pointer for parents and a `git_tree` pointer for tree, to ensure that corrupted commits cannot be generated. - All the different tag creation methods are gone; tag creation now always requires a `git_object` pointer to ensure that tags are not created to inexisting objects.
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h73
1 files changed, 12 insertions, 61 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 356b875cd..84adef596 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -193,7 +193,8 @@ GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsig
GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned int n);
/**
- * Create a new commit in the repository
+ * Create a new commit in the repository using `git_object`
+ * instances as parameters.
*
* @param oid Pointer where to store the OID of the
* newly created commit
@@ -214,16 +215,16 @@ GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned i
*
* @param message Full message for this commit
*
- * @param tree_oid Object ID of the tree for this commit. Note that
- * no validation is performed on this OID. Use the _o variants of
- * this method to assure a proper tree is passed to the commit.
+ * @param tree An instance of a `git_tree` object that will
+ * be used as the tree for the commit. This tree object must
+ * also be owned by the given `repo`.
*
* @param parent_count Number of parents for this commit
*
- * @param parent_oids[] Array of pointers to parent OIDs for this commit.
- * Note that no validation is performed on these OIDs. Use the _o
- * variants of this method to assure that are parents for the commit
- * are proper objects.
+ * @param parents[] Array of `parent_count` pointers to `git_commit`
+ * objects that will be used as the parents for this commit. This
+ * array may be NULL if `parent_count` is 0 (root commit). All the
+ * given commits must be owned by the `repo`.
*
* @return 0 on success; error code otherwise
* The created commit will be written to the Object Database and
@@ -236,38 +237,13 @@ GIT_EXTERN(int) git_commit_create(
const git_signature *author,
const git_signature *committer,
const char *message,
- const git_oid *tree_oid,
- int parent_count,
- const git_oid *parent_oids[]);
-
-/**
- * Create a new commit in the repository using `git_object`
- * instances as parameters.
- *
- * The `tree_oid` and `parent_oids` paremeters now take a instance
- * of `git_tree` and `git_commit`, respectively.
- *
- * All other parameters remain the same
- *
- * @see git_commit_create
- */
-GIT_EXTERN(int) git_commit_create_o(
- git_oid *oid,
- git_repository *repo,
- const char *update_ref,
- const git_signature *author,
- const git_signature *committer,
- const char *message,
const git_tree *tree,
int parent_count,
const git_commit *parents[]);
/**
- * Create a new commit in the repository using `git_object`
- * instances and a variable argument list.
- *
- * The `tree_oid` paremeter now takes a instance
- * of `const git_tree *`.
+ * Create a new commit in the repository using a variable
+ * argument list.
*
* The parents for the commit are specified as a variable
* list of pointers to `const git_commit *`. Note that this
@@ -278,31 +254,6 @@ GIT_EXTERN(int) git_commit_create_o(
*
* @see git_commit_create
*/
-GIT_EXTERN(int) git_commit_create_ov(
- git_oid *oid,
- git_repository *repo,
- const char *update_ref,
- const git_signature *author,
- const git_signature *committer,
- const char *message,
- const git_tree *tree,
- int parent_count,
- ...);
-
-
-/**
- * Create a new commit in the repository using
- * a variable argument list.
- *
- * The parents for the commit are specified as a variable
- * list of pointers to `const git_oid *`. Note that this
- * is a convenience method which may not be safe to export
- * for certain languages or compilers
- *
- * All other parameters remain the same
- *
- * @see git_commit_create
- */
GIT_EXTERN(int) git_commit_create_v(
git_oid *oid,
git_repository *repo,
@@ -310,7 +261,7 @@ GIT_EXTERN(int) git_commit_create_v(
const git_signature *author,
const git_signature *committer,
const char *message,
- const git_oid *tree_oid,
+ const git_tree *tree,
int parent_count,
...);