Skip to content

pr-834/derrickstolee/for-each-repo-empty-config-v2

From: Derrick Stolee <dstolee@microsoft.com>

'git for-each-repo --config=X' should return success without calling any
subcommands when the config key 'X' has no value. The current
implementation instead segfaults.

A user could run into this issue if they used 'git maintenance start' to
initialize their cron schedule using 'git for-each-repo
--config=maintenance.repo ...' but then using 'git maintenance
unregister' to remove the config option. (Note: 'git maintenance stop'
would remove the config _and_ remove the cron schedule.)

Add a simple test to ensure this works.

Reported-by: Andreas Bühmann <dev@uuml.de>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>

Submitted-As: https://lore.kernel.org/git/pull.834.v2.git.1609960783988.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.834.git.1609857770445.gitgitgadget@gmail.com
Assets 2