summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-02-06 15:27:34 -0500
committerGitHub <noreply@github.com>2022-02-06 15:27:34 -0500
commitd9863fc19eed8135f2fbcc4ee22ea950dcd6fddf (patch)
tree881d68ee13db8edbdb1370de319e536c515cdadd /include/git2
parent4efd6563cab0caeeeb442b688523a7683cc20174 (diff)
parent70d9bfa47c14fd230d081cebb9933622136479ea (diff)
downloadlibgit2-d9863fc19eed8135f2fbcc4ee22ea950dcd6fddf.tar.gz
Merge pull request #6192 from libgit2/ethomson/sha256_preparation
SHA256: early preparation
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/index.h3
-rw-r--r--include/git2/indexer.h14
-rw-r--r--include/git2/pack.h28
3 files changed, 38 insertions, 7 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 3cf64d827..981535dad 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -296,6 +296,7 @@ GIT_EXTERN(int) git_index_write(git_index *index);
*/
GIT_EXTERN(const char *) git_index_path(const git_index *index);
+#ifndef GIT_DEPRECATE_HARD
/**
* Get the checksum of the index
*
@@ -303,10 +304,12 @@ GIT_EXTERN(const char *) git_index_path(const git_index *index);
* last 20 bytes which are the checksum itself). In cases where the
* index does not exist on-disk, it will be zeroed out.
*
+ * @deprecated this function is deprecated with no replacement
* @param index an existing index object
* @return a pointer to the checksum of the index
*/
GIT_EXTERN(const git_oid *) git_index_checksum(git_index *index);
+#endif
/**
* Read a tree into the index file with stats
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 4bacbd317..ffe9bf366 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -129,16 +129,30 @@ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t si
*/
GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats);
+#ifndef GIT_DEPRECATE_HARD
/**
* Get the packfile's hash
*
* A packfile's name is derived from the sorted hashing of all object
* names. This is only correct after the index has been finalized.
*
+ * @deprecated use git_indexer_name
* @param idx the indexer instance
* @return the packfile's hash
*/
GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx);
+#endif
+
+/**
+ * Get the unique name for the resulting packfile.
+ *
+ * The packfile's name is derived from the packfile's content.
+ * This is only correct after the index has been finalized.
+ *
+ * @param idx the indexer instance
+ * @return a NUL terminated string for the packfile name
+ */
+GIT_EXTERN(const char *) git_indexer_name(const git_indexer *idx);
/**
* Free the indexer and its resources
diff --git a/include/git2/pack.h b/include/git2/pack.h
index 253a860cd..0f6bd2ab9 100644
--- a/include/git2/pack.h
+++ b/include/git2/pack.h
@@ -170,16 +170,30 @@ GIT_EXTERN(int) git_packbuilder_write(
git_indexer_progress_cb progress_cb,
void *progress_cb_payload);
+#ifndef GIT_DEPRECATE_HARD
/**
-* Get the packfile's hash
-*
-* A packfile's name is derived from the sorted hashing of all object
-* names. This is only correct after the packfile has been written.
-*
-* @param pb The packbuilder object
+ * Get the packfile's hash
+ *
+ * A packfile's name is derived from the sorted hashing of all object
+ * names. This is only correct after the packfile has been written.
+ *
+ * @deprecated use git_packbuilder_name
+ * @param pb The packbuilder object
* @return 0 or an error code
-*/
+ */
GIT_EXTERN(const git_oid *) git_packbuilder_hash(git_packbuilder *pb);
+#endif
+
+/**
+ * Get the unique name for the resulting packfile.
+ *
+ * The packfile's name is derived from the packfile's content.
+ * This is only correct after the packfile has been written.
+ *
+ * @param pb the packbuilder instance
+ * @return a NUL terminated string for the packfile name
+ */
+GIT_EXTERN(const char *) git_packbuilder_name(git_packbuilder *pb);
/**
* Callback used to iterate over packed objects