"William Sprent via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > In preparation for adding a sub-command to 'sparse-checkout' that can be > run in a bare repository, remove the 'NEED_WORK_TREE' flag from its > entry in the 'commands' array of 'git.c'. Given that "sparse-checkout" is about affecting which part of the directory hierarchies are to be materialized in the working tree, the idea to add a subcommand that does not require a working tree to the command by itself smells very iffy, and the changes necessary to protect the existing commands from the breakage caused by the decision to drop NEED_WORK_TREE bit, i.e. sprinkling many setup_work_tree() calls, somehow looks like they are solving a problem that did not have to get created in the first place. But you did not find a place the feature you wanted to add with [2/2] would fit better, perhaps, in which case, somebody else may be able to suggest an alternative in their reviews of that step, hopefully.