summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-04-05 10:39:01 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-04-10 11:02:12 +0100
commit523f893f6fac92e301b090b141b449183947e3b3 (patch)
tree11202ec3ccefc96deaf9719f792a7fc240f05b34 /include/git2
parentc616ba2d1ebab52af0315235932659d81d238876 (diff)
downloadlibgit2-523f893f6fac92e301b090b141b449183947e3b3.tar.gz
index: add sha256 support
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/index.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 981535dad..6e806371b 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -184,7 +184,12 @@ typedef enum {
* @param index_path the path to the index file in disk
* @return 0 or an error code
*/
+
+#ifdef GIT_EXPERIMENTAL_SHA256
+GIT_EXTERN(int) git_index_open(git_index **out, const char *index_path, git_oid_t oid_type);
+#else
GIT_EXTERN(int) git_index_open(git_index **out, const char *index_path);
+#endif
/**
* Create an in-memory index object.
@@ -197,7 +202,11 @@ GIT_EXTERN(int) git_index_open(git_index **out, const char *index_path);
* @param out the pointer for the new index
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
+GIT_EXTERN(int) git_index_new(git_index **out, git_oid_t oid_type);
+#else
GIT_EXTERN(int) git_index_new(git_index **out);
+#endif
/**
* Free an existing index object.