diff options
Diffstat (limited to 'builtin/fast-import.c')
-rw-r--r-- | builtin/fast-import.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/builtin/fast-import.c b/builtin/fast-import.c index d21c4053a7..1e7ab67f6e 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "lockfile.h" #include "object.h" @@ -206,8 +206,8 @@ static unsigned int object_entry_alloc = 5000; static struct object_entry_pool *blocks; static struct hashmap object_table; static struct mark_set *marks; -static const char *export_marks_file; -static const char *import_marks_file; +static char *export_marks_file; +static char *import_marks_file; static int import_marks_file_from_stream; static int import_marks_file_ignore_missing; static int import_marks_file_done; @@ -3274,6 +3274,7 @@ static void option_import_marks(const char *marks, read_marks(); } + free(import_marks_file); import_marks_file = make_fast_import_path(marks); import_marks_file_from_stream = from_stream; import_marks_file_ignore_missing = ignore_missing; @@ -3316,6 +3317,7 @@ static void option_active_branches(const char *branches) static void option_export_marks(const char *marks) { + free(export_marks_file); export_marks_file = make_fast_import_path(marks); } @@ -3357,6 +3359,8 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list) free(f); string_list_insert(list, s)->util = ms; + + free(s); } static int parse_one_option(const char *option) @@ -3481,8 +3485,8 @@ static void git_pack_config(void) if (!git_config_get_int("pack.indexversion", &indexversion_value)) { pack_idx_opts.version = indexversion_value; if (pack_idx_opts.version > 2) - git_die_config("pack.indexversion", - "bad pack.indexVersion=%"PRIu32, pack_idx_opts.version); + git_die_config(the_repository, "pack.indexversion", + "bad pack.indexVersion=%"PRIu32, pack_idx_opts.version); } if (!git_config_get_ulong("pack.packsizelimit", &packsizelimit_value)) max_packsize = packsizelimit_value; @@ -3533,7 +3537,10 @@ static void parse_argv(void) build_mark_map(&sub_marks_from, &sub_marks_to); } -int cmd_fast_import(int argc, const char **argv, const char *prefix) +int cmd_fast_import(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { unsigned int i; |