mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user