diff options
Diffstat (limited to 'midx.c')
-rw-r--r-- | midx.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,9 +1,14 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "abspath.h" +#include "alloc.h" #include "config.h" #include "csum-file.h" #include "dir.h" +#include "gettext.h" +#include "hex.h" #include "lockfile.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "hash-lookup.h" #include "midx.h" @@ -1326,17 +1331,17 @@ static int write_midx_internal(const char *object_dir, } if (preferred_pack_name) { - int found = 0; + ctx.preferred_pack_idx = -1; + for (i = 0; i < ctx.nr; i++) { if (!cmp_idx_or_pack_name(preferred_pack_name, ctx.info[i].pack_name)) { ctx.preferred_pack_idx = i; - found = 1; break; } } - if (!found) + if (ctx.preferred_pack_idx == -1) warning(_("unknown preferred pack: '%s'"), preferred_pack_name); } else if (ctx.nr && @@ -1607,7 +1612,7 @@ struct clear_midx_data { const char *ext; }; -static void clear_midx_file_ext(const char *full_path, size_t full_path_len, +static void clear_midx_file_ext(const char *full_path, size_t full_path_len UNUSED, const char *file_name, void *_data) { struct clear_midx_data *data = _data; |