diff options
Diffstat (limited to 'examples/index-pack.c')
-rw-r--r-- | examples/index-pack.c | 9 |
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; |