summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-07-13 22:25:11 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2022-07-13 22:50:33 -0400
commitb43567d655b6fbc562a165095a6980d19c4ae278 (patch)
treeee84020f9f2c9f53a1f11656e2cd1205502cda48 /include/git2
parent433a133402fae298f8ee7613bcfd997c2712d269 (diff)
downloadlibgit2-b43567d655b6fbc562a165095a6980d19c4ae278.tar.gz
sha256: indirection for experimental functions
The experimental function signature is only available when `GIT_EXPERIMENTAL_SHA256` is enabled.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/odb.h16
-rw-r--r--include/git2/odb_backend.h10
-rw-r--r--include/git2/oid.h16
3 files changed, 42 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 0952a1be0..c7d6a894c 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -68,7 +68,11 @@ typedef struct {
* @param opts the options for this object database or NULL for defaults
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_odb_new(git_odb **out, const git_odb_options *opts);
+#else
+GIT_EXTERN(int) git_odb_new(git_odb **out);
+#endif
/**
* Create a new object database and automatically add
@@ -87,10 +91,14 @@ GIT_EXTERN(int) git_odb_new(git_odb **out, const git_odb_options *opts);
* @param opts the options for this object database or NULL for defaults
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_odb_open(
git_odb **out,
const char *objects_dir,
const git_odb_options *opts);
+#else
+GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir);
+#endif
/**
* Add an on-disk alternate to an existing Object DB.
@@ -471,12 +479,16 @@ GIT_EXTERN(int) git_odb_write_multi_pack_index(
* @param oid_type the oid type to hash to
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_odb_hash(
git_oid *out,
const void *data,
size_t len,
git_object_t object_type,
git_oid_t oid_type);
+#else
+GIT_EXTERN(int) git_odb_hash(git_oid *out, const void *data, size_t len, git_object_t type);
+#endif
/**
* Read a file from disk and fill a git_oid with the object id
@@ -492,11 +504,15 @@ GIT_EXTERN(int) git_odb_hash(
* @param oid_type the oid type to hash to
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_odb_hashfile(
git_oid *out,
const char *path,
git_object_t object_type,
git_oid_t oid_type);
+#else
+GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path, git_object_t type);
+#endif
/**
* Create a copy of an odb_object
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h
index 092eb91ae..a31d1b782 100644
--- a/include/git2/odb_backend.h
+++ b/include/git2/odb_backend.h
@@ -85,10 +85,20 @@ typedef struct {
*
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_odb_backend_loose(
git_odb_backend **out,
const char *objects_dir,
git_odb_backend_loose_options *opts);
+#else
+GIT_EXTERN(int) git_odb_backend_loose(
+ git_odb_backend **out,
+ const char *objects_dir,
+ int compression_level,
+ int do_fsync,
+ unsigned int dir_mode,
+ unsigned int file_mode);
+#endif
/**
* Create a backend out of a single packfile
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 3e828ae70..399b7b907 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -122,7 +122,11 @@ typedef struct git_oid {
* @param type the type of object id
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str, git_oid_t type);
+#else
+GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str);
+#endif
/**
* Parse a hex formatted NUL-terminated string into a git_oid.
@@ -132,7 +136,11 @@ GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str, git_oid_t type);
* @param type the type of object id
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str, git_oid_t type);
+#else
+GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str);
+#endif
/**
* Parse N characters of a hex formatted object id into a git_oid.
@@ -146,7 +154,11 @@ GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str, git_oid_t type);
* @param type the type of object id
* @return 0 or an error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length, git_oid_t type);
+#else
+GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length);
+#endif
/**
* Copy an already raw oid into a git_oid structure.
@@ -155,7 +167,11 @@ GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length, g
* @param raw the raw input bytes to be copied.
* @return 0 on success or error code
*/
+#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_oid_fromraw(git_oid *out, const unsigned char *raw, git_oid_t type);
+#else
+GIT_EXTERN(int) git_oid_fromraw(git_oid *out, const unsigned char *raw);
+#endif
/**
* Format a git_oid into a hex string.