git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t5541: Improve push test
@ 2013-12-09 20:03 Torsten Bögershausen
  2013-12-09 22:10 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Torsten Bögershausen @ 2013-12-09 20:03 UTC (permalink / raw)
  To: git; +Cc: tboegi

The old log-line looked like this:
 + 9d498b0...8598732 master -> master (forced update)
And the new one like this:
   9d498b0..8598732  master -> master

- Loosen the grep pattern by not demanding "(forced update)"
- Improve the grep pattern and check the new SHA id

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
The following revealed a weakness in t5541:
 commit f9e3c6bebb89de12f2dfdaa1899cb22e9ef32542
 Author: Felipe Contreras <felipe.contreras@gmail.com>
 Date:   Tue Nov 12 14:56:57 2013 -0600
    transport-helper: check for 'forced update' message
So don't look for forced update, but check for the SHA.

(I want to fix a missing "&&" as well, that is for the next commit)
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 470ac54..1468a07 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -168,7 +168,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 	test_must_fail git push -v origin +master master:retsam >output 2>&1'
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
-	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
+	newsha=$(git log --oneline -n1 | sed -e "s/^\([0-9a-f]*\).*/\1/") &&
+	grep "\.\.$newsha *master -> master" output &&
 	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
 '
 
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-11 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 20:03 [PATCH] t5541: Improve push test Torsten Bögershausen
2013-12-09 22:10 ` Junio C Hamano
2013-12-11 15:13   ` Torsten Bögershausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).