Skip to content

Commit

Permalink
t5541-http-push: make grep expression check for one line only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tay Ray Chuan authored and Junio C Hamano committed Jan 25, 2010
1 parent 0aa958d commit 9567f08
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions t/t5541-http-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand All @@ -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
Expand Down

0 comments on commit 9567f08

Please sign in to comment.