[PATCH 2/3] fixup! t5528-push-default.sh: add helper functions

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

 



Please eyeball the change to test_push_failure(); I think it is correct
to use the same "log --no-walk" to prepare expect and actual, but I may
have missed something.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 t/t5528-push-default.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index 43dec43..4a7d7fe 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -16,7 +16,7 @@ test_expect_success 'setup bare remotes' '
 # $1 = local revision
 # $2 = remote revision (tested to be equal to the local one)
 check_pushed_commit () {
-	git log -1 --format='%h %s' >expect &&
+	git log -1 --format='%h %s' "$1" >expect &&
 	git --git-dir=repo1 log -1 --format='%h %s' "$2" >actual &&
 	test_cmp expect actual
 }
@@ -39,11 +39,11 @@ test_push_failure () {
 		test_might_fail git --git-dir=repo1 \
 			log --no-walk --format='%h %s' "$@" >expect
 	fi &&
-	test_must_fail git -c push.default="$1" &&
+	test_must_fail git -c push.default="$push_default" push &&
 	if test $# -gt 0
 	then
 		test_might_fail git --git-dir=repo1 \
-			log -1 --format='%h %s' "$@" >actual
+			log --no-walk --format='%h %s' "$@" >actual
 	fi &&
 	test_cmp expect actual
 }
@@ -61,7 +61,7 @@ test_expect_success '"upstream" does not push on unconfigured remote' '
 	test_unconfig branch.master.remote &&
 	test_config push.default upstream &&
 	test_commit three &&
-	test_push_failure upstream master
+	test_push_failure upstream --all
 '
 
 test_expect_success '"upstream" does not push on unconfigured branch' '
@@ -70,7 +70,7 @@ test_expect_success '"upstream" does not push on unconfigured branch' '
 	test_unconfig branch.master.merge &&
 	test_config push.default upstream
 	test_commit four &&
-	test_push_failure upstream master
+	test_push_failure upstream --all
 '
 
 test_expect_success '"upstream" does not push when remotes do not match' '
-- 
1.7.10.376.g4eb25

--
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]