diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-22 14:19:13 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-27 20:15:09 -0500 |
commit | d2458af7b7227f0b378e1509d7dfeb958c339590 (patch) | |
tree | 66d42fb7f43efd01fe658f4806af50506838b389 /examples | |
parent | 11ef76a9f5bc04cb61760abebc68e6ac5045bf68 (diff) | |
download | libgit2-d2458af7b7227f0b378e1509d7dfeb958c339590.tar.gz |
indexer: use a byte array for checksum
The index's checksum is not an object ID, so we should not use the
`git_oid` type. Use a byte array for checksum calculation and storage.
Deprecate the `git_indexer_hash` function. Callers should use the new
`git_indexer_name` function which provides a unique packfile name.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/index-pack.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/index-pack.c b/examples/index-pack.c index c58ac038a..df37dd0c4 100644 --- a/examples/index-pack.c +++ b/examples/index-pack.c @@ -17,7 +17,6 @@ int lg2_index_pack(git_repository *repo, int argc, char **argv) git_indexer *idx; git_indexer_progress stats = {0, 0}; int error; - char hash[GIT_OID_HEXSZ + 1] = {0}; int fd; ssize_t read_bytes; char buf[512]; @@ -61,8 +60,7 @@ int lg2_index_pack(git_repository *repo, int argc, char **argv) printf("\rIndexing %u of %u\n", stats.indexed_objects, stats.total_objects); - git_oid_fmt(hash, git_indexer_hash(idx)); - puts(hash); + puts(git_indexer_name(idx)); cleanup: close(fd); |