Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:54

Junio C Hamano [off-list ref] writes:
Johan Herland [off-list ref] writes:
quoted
quoted
+       git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual &&
Isn't  ${3:-repo1} a bashism?
I do not think so.  But now I looked at it again, I think I would
use ${3-repo1} form in this case myself.  No caller passes an empty
string to the third place.
Actually, because the caller blindly does this:

    # $3 = [optional] repo to check for actual output (repo1 by default)
    test_push_success () {
            git -c push.default="$1" push &&
            check_pushed_commit HEAD "$2" "$3"
    }

where it should be doing something like this:

            check_pushed_commit HEAD "$2" ${3+"$3"}

if it wants $3 to be "optional", ${3:-repo1} is needed here to work
it around.

So I'll leave it as-is for now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help