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_repositoryinside_git_dirinside_work_treeis_bare_repository_cfggit_work_tree_cfg
Edited by Patrick Steinhardt