Skip to content

Commit 2219b37

Browse files
committed
t3701: verify the shown messages when nothing can be added
In preparation for re-implementing `git add -p` in pure C (where we will purposefully keep the implementation of `git add -p` separate from the implementation of `git add -i`), let's verify that the user is told the same things as in the Perl version when the diff file is either empty or contains only entries about binary files. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a8bd214 commit 2219b37

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t3701-add-interactive.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ test_expect_success 'different prompts for mode change/deleted' '
291291
test_cmp expect actual.filtered
292292
'
293293

294+
test_expect_success 'correct message when there is nothing to do' '
295+
git reset --hard &&
296+
git add -p 2>err &&
297+
test_i18ngrep "No changes" err &&
298+
printf "\\0123" >binary &&
299+
git add binary &&
300+
printf "\\0abc" >binary &&
301+
git add -p 2>err &&
302+
test_i18ngrep "Only binary files changed" err
303+
'
304+
294305
test_expect_success 'setup again' '
295306
git reset --hard &&
296307
test_chmod +x file &&

0 commit comments

Comments
 (0)