[PATCH 2/3] fixup! t5528-push-default.sh: add helper functions
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:39
Subsystem:
the rest · Maintainer:
Linus Torvalds
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 <redacted> --- 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