vendor/libgit2/src/odb_pack.c in rugged-0.21.4 vs vendor/libgit2/src/odb_pack.c in rugged-0.22.0b1
- old
+ new
@@ -208,11 +208,11 @@
if (memcmp(p->pack_name, path_str, cmp_len) == 0)
return 0;
}
- error = git_packfile_alloc(&pack, path->ptr);
+ error = git_mwindow_get_pack(&pack, path->ptr);
/* ignore missing .pack file as git does */
if (error == GIT_ENOTFOUND) {
giterr_clear();
return 0;
@@ -603,11 +603,11 @@
backend = (struct pack_backend *)_backend;
for (i = 0; i < backend->packs.length; ++i) {
struct git_pack_file *p = git_vector_get(&backend->packs, i);
- git_packfile_free(p);
+ git_mwindow_put_pack(p);
}
git_vector_free(&backend->packs);
git__free(backend->pack_folder);
git__free(backend);
@@ -645,11 +645,11 @@
struct git_pack_file *packfile = NULL;
if (pack_backend__alloc(&backend, 1) < 0)
return -1;
- if (git_packfile_alloc(&packfile, idx) < 0 ||
+ if (git_mwindow_get_pack(&packfile, idx) < 0 ||
git_vector_insert(&backend->packs, packfile) < 0)
{
pack_backend__free((git_odb_backend *)backend);
return -1;
}
@@ -661,9 +661,12 @@
int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir)
{
int error = 0;
struct pack_backend *backend = NULL;
git_buf path = GIT_BUF_INIT;
+
+ if (git_mwindow_files_init() < 0)
+ return -1;
if (pack_backend__alloc(&backend, 8) < 0)
return -1;
if (!(error = git_buf_joinpath(&path, objects_dir, "pack")) &&