]> rtime.felk.cvut.cz Git - git.git/commitdiff
t5541-http-push: make grep expression check for one line only
authorTay Ray Chuan <rctay89@gmail.com>
Mon, 25 Jan 2010 07:42:23 +0000 (15:42 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jan 2010 17:53:02 +0000 (09:53 -0800)
Don't feed a multiple-line pattern to grep and expect the them to match
with lines in order.

Simplify the grep expressions in the non-fast-forward tests to check
only for the first line of the non-fast-forward warning - having that
line should be enough assurance that the full warning is printed.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5541-http-push.sh

index 83a8e14c6c385d6d6fbdd179d30018128e8a200f..53f54a2789557bcfd4e9843b50fe28189fa6f356 100755 (executable)
@@ -105,10 +105,8 @@ test_expect_success 'non-fast-forward push show ref status' '
 '
 
 test_expect_success 'non-fast-forward push shows help message' '
-       grep \
-"To prevent you from losing history, non-fast-forward updates were rejected
-Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
-section of '"'git push --help'"' for details." output
+       grep "To prevent you from losing history, non-fast-forward updates were rejected" \
+               output
 '
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
@@ -126,10 +124,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
        grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
        grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&
 
-       grep \
-"To prevent you from losing history, non-fast-forward updates were rejected
-Merge the remote changes before pushing again.  See the '"'non-fast-forward'"'
-section of '"'git push --help'"' for details." output
+       grep "To prevent you from losing history, non-fast-forward updates were rejected" \
+               output
 '
 
 stop_httpd