&existing->cruft_packs);
}
-static void remove_redundant_pack(struct repository *repo,
- const char *dir_name, const char *base_name)
-{
- struct strbuf buf = STRBUF_INIT;
- struct odb_source *source = repo->objects->sources;
- struct multi_pack_index *m = get_multi_pack_index(source);
- strbuf_addf(&buf, "%s.pack", base_name);
- if (m && source->local && midx_contains_pack(m, buf.buf))
- clear_midx_file(repo);
- strbuf_insertf(&buf, 0, "%s/", dir_name);
- unlink_pack_path(buf.buf, 1);
- strbuf_release(&buf);
-}
-
static void remove_redundant_packs_1(struct repository *repo,
struct string_list *packs)
{
for_each_string_list_item(item, packs) {
if (!existing_pack_is_marked_for_deletion(item))
continue;
- remove_redundant_pack(repo, packdir, item->string);
+ repack_remove_redundant_pack(repo, packdir, item->string);
}
}
(string_list_has_string(&existing->kept_packs, buf.buf)))
continue;
- remove_redundant_pack(existing->repo, packdir, buf.buf);
+ repack_remove_redundant_pack(existing->repo, packdir, buf.buf);
}
strbuf_release(&buf);
#include "git-compat-util.h"
+#include "midx.h"
+#include "odb.h"
+#include "packfile.h"
#include "repack.h"
+#include "repository.h"
#include "run-command.h"
void prepare_pack_objects(struct child_process *cmd,
free(args->threads);
list_objects_filter_release(&args->filter_options);
}
+
+void repack_remove_redundant_pack(struct repository *repo, const char *dir_name,
+ const char *base_name)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct odb_source *source = repo->objects->sources;
+ struct multi_pack_index *m = get_multi_pack_index(source);
+ strbuf_addf(&buf, "%s.pack", base_name);
+ if (m && source->local && midx_contains_pack(m, buf.buf))
+ clear_midx_file(repo);
+ strbuf_insertf(&buf, 0, "%s/", dir_name);
+ unlink_pack_path(buf.buf, 1);
+ strbuf_release(&buf);
+}
const char *out);
void pack_objects_args_release(struct pack_objects_args *args);
+void repack_remove_redundant_pack(struct repository *repo, const char *dir_name,
+ const char *base_name);
+
#endif /* REPACK_H */