Skip to content

Remove is_bare_repository_cfg global state

John Cai via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3git: remove is_bare_repository_cfg global variableattr.c builtin/bisect.c builtin/blame.c +25 more+70 -554 replies
2/3setup: initialize is_bare_cfgsetup.c+7 -01 reply
3/3repository: BUG when is_bare_cfg is not initializedrepository.c+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Remove is_bare_repository_cfg global state

This patch series removes the global state introduced by the is_bare_repository_cfg variable by moving it into the repository struct. Most of the refactor is done by patch 1. Patch 2 initializes the member in places that left it unInitialized, while patch 3 adds a safety measure by BUG()ing when the variable has not been properly initialized.

John Cai (3):
git: remove is_bare_repository_cfg global variable
setup: initialize is_bare_cfg
repository: BUG when is_bare_cfg is not initialized

 attr.c                        |  4 ++--
 builtin/bisect.c              |  2 +-
 builtin/blame.c               |  2 +-
 builtin/check-attr.c          |  2 +-
 builtin/clone.c               |  4 ++--
 builtin/gc.c                  |  2 +-
 builtin/init-db.c             | 14 +++++++-------
 builtin/repack.c              |  2 +-
 builtin/reset.c               |  2 +-
 builtin/rev-parse.c           |  2 +-
 builtin/submodule--helper.c   |  2 +-
 config.c                      |  2 +-
 dir.c                         |  2 +-
 environment.c                 |  7 -------
 environment.h                 |  3 +--
 git.c                         |  2 +-
 mailmap.c                     |  4 ++--
 refs/files-backend.c          |  2 +-
 refs/reftable-backend.c       |  2 +-
 repository.c                  | 23 +++++++++++++++++++----
 repository.h                  | 12 +++++++++++-
 scalar.c                      |  2 +-
 setup.c                       | 19 +++++++++++++------
 submodule.c                   |  2 +-
 t/helper/test-partial-clone.c |  2 +-
 t/helper/test-repository.c    |  4 ++--
 transport.c                   |  4 ++--
 worktree.c                    |  4 ++--
 28 files changed, 79 insertions(+), 55 deletions(-)

base-commit: 8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1826%2Fjohn-cai%2Fjc%2Fremove_is_bare_global-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1826/john-cai/jc/remove_is_bare_global-v1
Pull-Request: https://github.com/git/git/pull/1826

Signature · 1 line
gitgitgadget