Skip to content

Commit 7f554a4

Browse files
committed
Merge branch 'tb/reverse-midx'
The code that gives an error message in "git multi-pack-index" when no subcommand is given tried to print a NULL pointer as a strong, which has been corrected. * tb/reverse-midx: multi-pack-index: fix potential segfault without sub-command
2 parents aaf113e + 88617d1 commit 7f554a4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

builtin/multi-pack-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ int cmd_multi_pack_index(int argc, const char **argv,
176176
else if (!strcmp(argv[0], "expire"))
177177
return cmd_multi_pack_index_expire(argc, argv);
178178
else {
179-
usage:
180179
error(_("unrecognized subcommand: %s"), argv[0]);
180+
usage:
181181
usage_with_options(builtin_multi_pack_index_usage,
182182
builtin_multi_pack_index_options);
183183
}

t/t5319-multi-pack-index.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,4 +837,9 @@ test_expect_success 'load reverse index when missing .idx, .pack' '
837837
)
838838
'
839839

840+
test_expect_success 'usage shown without sub-command' '
841+
test_expect_code 129 git multi-pack-index 2>err &&
842+
! test_i18ngrep "unrecognized subcommand" err
843+
'
844+
840845
test_done

0 commit comments

Comments
 (0)