summaryrefslogtreecommitdiff
path: root/include/git2/pack.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-22 17:34:36 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-01-23 09:48:20 -0500
commit69ca594bafd438fea419b1ebe757a9d13da4d254 (patch)
treeb7b760bb90311ee4cd511d697d54c1ff8a1d97a8 /include/git2/pack.h
parent55eb096b93d4e658bfc0d19270b56f00dff9ec0d (diff)
downloadlibgit2-ethomson/oid_cleanups.tar.gz
packbuilder: use the packfile name instead of hashethomson/oid_cleanups
Deprecate the `git_packfile_hash` function. Callers should use the new `git_packfile_name` function which provides a unique packfile name.
Diffstat (limited to 'include/git2/pack.h')
-rw-r--r--include/git2/pack.h28
1 files changed, 21 insertions, 7 deletions
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