summaryrefslogtreecommitdiff
path: root/include/git2/oid.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/oid.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/oid.h')
-rw-r--r--include/git2/oid.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 06bbfcc55..46d0dce0d 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -65,6 +65,19 @@ typedef struct {
GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str);
/**
+ * Parse N characters of a hex formatted object id into a git_oid
+ *
+ * If N is odd, N-1 characters will be parsed instead.
+ * The remaining space in the git_oid will be set to zero.
+ *
+ * @param out oid structure the result is written into.
+ * @param str input hex string of at least size `length`
+ * @param length length of the input string
+ * @return GIT_SUCCESS if valid; GIT_ENOTOID on failure.
+ */
+GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length);
+
+/**
* Copy an already raw oid into a git_oid structure.
*
* @param out oid structure the result is written into.