Skip to content

Disentangle "setup.c" from using global state

"setup.c" is responsible for discovering and setting up repositories. It is quite an entangled mess though and relies on a bunch of global variables, including the_repository. We should disentangle this mess and try to refactor the code to become as pure as possible.

Non-exhaustive list of global dependencies to get rid of:

  • the_repository
  • inside_git_dir
  • inside_work_tree
  • is_bare_repository_cfg
  • git_work_tree_cfg
Edited by Patrick Steinhardt