Browse Source

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
maint
Junio C Hamano 4 years ago
parent
commit
7f554a4f69
  1. 2
      builtin/multi-pack-index.c
  2. 5
      t/t5319-multi-pack-index.sh

2
builtin/multi-pack-index.c

@ -176,8 +176,8 @@ int cmd_multi_pack_index(int argc, const char **argv, @@ -176,8 +176,8 @@ int cmd_multi_pack_index(int argc, const char **argv,
else if (!strcmp(argv[0], "expire"))
return cmd_multi_pack_index_expire(argc, argv);
else {
usage:
error(_("unrecognized subcommand: %s"), argv[0]);
usage:
usage_with_options(builtin_multi_pack_index_usage,
builtin_multi_pack_index_options);
}

5
t/t5319-multi-pack-index.sh

@ -837,4 +837,9 @@ test_expect_success 'load reverse index when missing .idx, .pack' ' @@ -837,4 +837,9 @@ test_expect_success 'load reverse index when missing .idx, .pack' '
)
'

test_expect_success 'usage shown without sub-command' '
test_expect_code 129 git multi-pack-index 2>err &&
! test_i18ngrep "unrecognized subcommand" err
'

test_done

Loading…
Cancel
Save