summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle J. McKay <mackyle@gmail.com>2015-03-08 08:37:50 -0700
committerJunio C Hamano <gitster@pobox.com>2015-03-10 15:23:28 -0700
commitce026cc7e2ff729c9809fef860cd696d1f7bb06c (patch)
tree1f062037cfb41e942b568c9923cc585910074b0e
parentb680a86a86f44444643b9be5bf4822feda128cd0 (diff)
downloadgit-km/bsd-shells.tar.gz
t5528: do not fail with FreeBSD shellkm/bsd-shells
The FreeBSD shell converts this expression: git ${1:+-c push.default="$1"} push to this when "$1" is not empty: git "-c push.default=$1" push which causes git to fail. To avoid this we simply break up the expansion into two parts so that the whitespace which creates two arguments instead of one is outside the ${...} like so: git ${1:+-c} ${1:+push.default="$1"} push This has the desired effect on all platforms allowing the test to pass on FreeBSD. Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5528-push-default.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index cc7451908b..73f4bb6346 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -26,7 +26,7 @@ check_pushed_commit () {
# $2 = expected target branch for the push
# $3 = [optional] repo to check for actual output (repo1 by default)
test_push_success () {
- git ${1:+-c push.default="$1"} push &&
+ git ${1:+-c} ${1:+push.default="$1"} push &&
check_pushed_commit HEAD "$2" "$3"
}
@@ -34,7 +34,7 @@ test_push_success () {
# check that push fails and does not modify any remote branch
test_push_failure () {
git --git-dir=repo1 log --no-walk --format='%h %s' --all >expect &&
- test_must_fail git ${1:+-c push.default="$1"} push &&
+ test_must_fail git ${1:+-c} ${1:+push.default="$1"} push &&
git --git-dir=repo1 log --no-walk --format='%h %s' --all >actual &&
test_cmp expect actual
}