Skip to content

Commit ca2a7c4

Browse files
committed
add--interactive.perl: use add--helper --show-help for help_cmd
Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper. If an error occurs, it will be reported, but the Perl script will not exit, since the add--helper is called within an eval block. Just like the change where the Perl script calls the add--helper to print the numstat, also here we forgo adding a regression test: the Perl script is on its way out (and this patch is part of that journey). Signed-off-by: Slavica Djukic <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
1 parent 0a27304 commit ca2a7c4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

git-add--interactive.perl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,16 +1718,8 @@ sub quit_cmd {
17181718
}
17191719

17201720
sub help_cmd {
1721-
# TRANSLATORS: please do not translate the command names
1722-
# 'status', 'update', 'revert', etc.
1723-
print colored $help_color, __ <<'EOF' ;
1724-
status - show paths with changes
1725-
update - add working tree state to the staged set of changes
1726-
revert - revert staged set of changes back to the HEAD version
1727-
patch - pick hunks and update selectively
1728-
diff - view diff between HEAD and index
1729-
add untracked - add contents of untracked files to the staged set of changes
1730-
EOF
1721+
my @help_cmd = ("git", "add--helper", "--show-help");
1722+
!system(@help_cmd) or die "@help_cmd exited with code $?";
17311723
}
17321724

17331725
sub process_args {

0 commit comments

Comments
 (0)