]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/setup-wo-the-repository' into seen
authorJunio C Hamano <gitster@pobox.com>
Tue, 28 Apr 2026 01:22:00 +0000 (10:22 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Apr 2026 01:22:00 +0000 (10:22 +0900)
Many uses of the_repository has been updated to use a more
appropriate struct repository instance in setup.c codepath.

* ps/setup-wo-the-repository:
  setup: stop using `the_repository` in `init_db()`
  setup: stop using `the_repository` in `create_reference_database()`
  setup: stop using `the_repository` in `initialize_repository_version()`
  setup: stop using `the_repository` in `check_repository_format()`
  setup: stop using `the_repository` in `upgrade_repository_format()`
  setup: stop using `the_repository` in `setup_git_directory()`
  setup: stop using `the_repository` in `setup_git_directory_gently()`
  setup: stop using `the_repository` in `setup_git_env()`
  setup: stop using `the_repository` in `set_git_work_tree()`
  setup: stop using `the_repository` in `setup_work_tree()`
  setup: stop using `the_repository` in `enter_repo()`
  setup: stop using `the_repository` in `verify_non_filename()`
  setup: stop using `the_repository` in `verify_filename()`
  setup: stop using `the_repository` in `path_inside_repo()`
  setup: stop using `the_repository` in `prefix_path()`
  setup: stop using `the_repository` in `is_inside_git_dir()`
  setup: stop using `the_repository` in `is_inside_worktree()`
  setup: replace use of `the_repository` in static functions

17 files changed:
1  2 
builtin/checkout.c
builtin/clone.c
builtin/mv.c
builtin/receive-pack.c
builtin/rev-parse.c
builtin/sparse-checkout.c
environment.h
git.c
http-push.c
line-log.c
object-name.c
refs.c
remote-curl.c
repository.h
revision.c
submodule.c
worktree.c

Simple merge
diff --cc builtin/clone.c
Simple merge
diff --cc builtin/mv.c
Simple merge
Simple merge
Simple merge
index 92d017b81f9a327b4ea77436c422b1609602b8c1,d89acbeb533bd80e49e7a0ed8dabd9e13fc112eb..0863d0fb460cf80bdbce6bcc270bd25eb81a557b
@@@ -980,10 -975,10 +981,10 @@@ static int sparse_checkout_clean(int ar
                OPT_END(),
        };
  
-       setup_work_tree();
+       setup_work_tree(the_repository);
        if (!cfg->apply_sparse_checkout)
                die(_("must be in a sparse-checkout to clean directories"));
 -      if (!core_sparse_checkout_cone)
 +      if (!cfg->core_sparse_checkout_cone)
                die(_("must be in a cone-mode sparse-checkout to clean directories"));
  
        argc = parse_options(argc, argv, prefix,
diff --cc environment.h
Simple merge
diff --cc git.c
Simple merge
diff --cc http-push.c
Simple merge
diff --cc line-log.c
Simple merge
diff --cc object-name.c
Simple merge
diff --cc refs.c
Simple merge
diff --cc remote-curl.c
Simple merge
diff --cc repository.h
Simple merge
diff --cc revision.c
index c936a60b7defb40a23be035515b0663e9a44c1e1,9071a38b85b5c76e3ddb02e2712e7ae544b07c74..5362616aff4220193c09a2864f3c9e3a17f31929
@@@ -2072,7 -2081,9 +2072,7 @@@ static int handle_dotdot_1(const char *
                return -1;
  
        if (!cant_be_filename) {
-               verify_non_filename(revs->prefix, full_name);
 -              *dotdot = '.';
 -              verify_non_filename(the_repository, revs->prefix, arg);
 -              *dotdot = '\0';
++              verify_non_filename(the_repository, revs->prefix, full_name);
        }
  
        a_obj = parse_object(revs->repo, &a_oid);
diff --cc submodule.c
Simple merge
diff --cc worktree.c
Simple merge