index: provide a index_options structure when opening

Instead of simply taking the oid type, future-proof our index opening
and creation functionality by taking an options structure.
This commit is contained in:
Edward Thomson
2024-12-16 16:48:22 +00:00
parent 009677e611
commit 708d64f1e8
3 changed files with 59 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ int lg2_show_index(git_repository *repo, int argc, char **argv)
dirlen = strlen(dir);
if (dirlen > 5 && strcmp(dir + dirlen - 5, "index") == 0) {
#ifdef GIT_EXPERIMENTAL_SHA256
check_lg2(git_index_open(&index, dir, GIT_OID_SHA1), "could not open index", dir);
check_lg2(git_index_open(&index, dir, NULL), "could not open index", dir);
#else
check_lg2(git_index_open(&index, dir), "could not open index", dir);
#endif