summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-09-21 05:09:46 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2023-02-12 22:02:00 +0000
commitfe2ee3a018286b04cd0c64f84d437c7317c8f138 (patch)
tree196a29fc72ef0a27e0277b4d142cc93c28fa4cb7 /examples
parent6204499242101d0f93cd7e56e259c900828e41e1 (diff)
downloadlibgit2-fe2ee3a018286b04cd0c64f84d437c7317c8f138.tar.gz
object: lookup sha256 objects
This is much of the plumbing for the object database to support SHA256, and for objects to be able to parse SHA256 versions of themselves.
Diffstat (limited to 'examples')
-rw-r--r--examples/index-pack.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/index-pack.c b/examples/index-pack.c
index df37dd0c4..0f8234c75 100644
--- a/examples/index-pack.c
+++ b/examples/index-pack.c
@@ -28,11 +28,18 @@ int lg2_index_pack(git_repository *repo, int argc, char **argv)
return EXIT_FAILURE;
}
- if (git_indexer_new(&idx, ".", 0, NULL, NULL) < 0) {
+#ifdef GIT_EXPERIMENTAL_SHA256
+ error = git_indexer_new(&idx, ".", git_repository_oid_type(repo), NULL);
+#else
+ error = git_indexer_new(&idx, ".", 0, NULL, NULL);
+#endif
+
+ if (error < 0) {
puts("bad idx");
return -1;
}
+
if ((fd = open(argv[1], 0)) < 0) {
perror("open");
return -1;