[PATCH] t5541: Improve push test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
The following revealed a weakness in t5541:
 commit f9e3c6bebb89de12f2dfdaa1899cb22e9ef32542
 Author: Felipe Contreras <felipe.contreras@xxxxxxxxx>
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]