THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

add -i: show progress counter in the prompt

Report the current hunk count and total number of hunks for the
current file in the prompt.  Also adjust the expected output in
some tests to match.

Signed-off-by: Kunal Tyagi <tyagi.kunal@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tags/v2.24.0-rc0
Kunal Tyagi Junio C Hamano 1 month ago
parent
commit
8085050ab4
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      git-add--interactive.perl
  2. +1
    -1
      t/t3701-add-interactive.sh

+ 1
- 1
git-add--interactive.perl View File

@@ -1541,7 +1541,7 @@ sub patch_update_file {
for (@{$hunk[$ix]{DISPLAY}}) {
print;
}
print colored $prompt_color,
print colored $prompt_color, "(", ($ix+1), "/$num) ",
sprintf(__($patch_update_prompt_modes{$patch_mode}{$hunk[$ix]{TYPE}}), $other);

my $line = prompt_single_character;

+ 1
- 1
t/t3701-add-interactive.sh View File

@@ -314,7 +314,7 @@ test_expect_success C_LOCALE_OUTPUT 'add first line works' '
git commit -am "clear local changes" &&
git apply patch &&
printf "%s\n" s y y | git add -p file 2>error |
sed -n -e "s/^Stage this hunk[^@]*\(@@ .*\)/\1/" \
sed -n -e "s/^([1-2]\/[1-2]) Stage this hunk[^@]*\(@@ .*\)/\1/" \
-e "/^[-+@ \\\\]"/p >output &&
test_must_be_empty error &&
git diff --cached >diff &&

Loading…
Cancel
Save