t7406: fix call that was failing for the wrong reason
authorElijah Newren <newren@gmail.com>
Wed, 8 Aug 2018 16:31:03 +0000 (09:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Aug 2018 17:52:55 +0000 (10:52 -0700)
A test making use of test_must_fail was failing like this:
fatal: ambiguous argument '|': unknown revision or path not in the working tree.
when the intent was to verify that a specific string was not found
in the output of the git diff command, i.e. that grep returned
non-zero. Fix the test to do that.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7406-submodule-update.sh
index f604ef7a7294b893b4e342d086ac67c760582177..ccdc2f9039ae403c2c120105afdb0f7460510daf 100755 (executable)
@@ -599,7 +599,8 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
         ) &&
         git diff --raw | grep "        submodule" &&
         git submodule update --checkout &&
-        test_must_fail git diff --raw \| grep "        submodule" &&
+        git diff --raw >out &&
+        ! grep "       submodule" out &&
         (cd submodule &&
          test_must_fail compare_head
         ) &&