Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-12-06 16:08:22 +0300
committerJunio C Hamano <gitster@pobox.com>2019-12-06 19:57:34 +0300
commit0c3222c4f322c586099d2773e180dabf6d4f6568 (patch)
treef86bd5e661882b5be24eadce068c925f05eebe97 /t/t3701-add-interactive.sh
parent24be352d52f96b2cace4d3e5f01f02917b7d649b (diff)
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index c90aaa25b0..797610e96d 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -291,6 +291,17 @@ test_expect_success 'different prompts for mode change/deleted' '
test_cmp expect actual.filtered
'
+test_expect_success 'correct message when there is nothing to do' '
+ git reset --hard &&
+ git add -p 2>err &&
+ test_i18ngrep "No changes" err &&
+ printf "\\0123" >binary &&
+ git add binary &&
+ printf "\\0abc" >binary &&
+ git add -p 2>err &&
+ test_i18ngrep "Only binary files changed" err
+'
+
test_expect_success 'setup again' '
git reset --hard &&
test_chmod +x file &&