Merge branch 'ps/maintenance-start-crash-fix' into maint-2.47

"git maintenance start" crashed due to an uninitialized variable
reference, which has been corrected.

* ps/maintenance-start-crash-fix:
  builtin/gc: fix crash when running `git maintenance start`
This commit is contained in:
Junio C Hamano
2024-11-20 14:42:57 +09:00
2 changed files with 21 additions and 2 deletions

View File

@ -1832,7 +1832,7 @@ static const char *get_extra_launchctl_strings(void) {
* | Input | Output |
* | *cmd | return code | *out | *is_available |
* +-------+-------------+-------------------+---------------+
* | "foo" | false | NULL | (unchanged) |
* | "foo" | false | "foo" (allocated) | (unchanged) |
* +-------+-------------+-------------------+---------------+
*
* GIT_TEST_MAINT_SCHEDULER set to “foo:./mock_foo.sh,bar:./mock_bar.sh”
@ -1850,8 +1850,11 @@ static int get_schedule_cmd(const char *cmd, int *is_available, char **out)
struct string_list_item *item;
struct string_list list = STRING_LIST_INIT_NODUP;
if (!testing)
if (!testing) {
if (out)
*out = xstrdup(cmd);
return 0;
}
if (is_available)
*is_available = 0;