Subject: Re: [PATCHv3 3/3] git-p4: tests: use test-chmtime in place of touch

From: Junio C Hamano <[email-masked]>
Date: Sun, 24 May 2015 11:56:03 -0700

Luke Diamand <[email-masked]> writes:

> diff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh
> index 166b840..fe65788 100755
> --- a/t/t9813-git-p4-preserve-users.sh
> +++ b/t/t9813-git-p4-preserve-users.sh
> @@ -53,7 +53,8 @@ test_expect_success 'preserve users' '
>  		git commit --author "Alice <[email-masked]>" -m "a change by alice" file1 &&
>  		git commit --author "Bob <[email-masked]>" -m "a change by bob" file2 &&
>  		git config git-p4.skipSubmitEditCheck true &&
> -		P4EDITOR=touch P4USER=alice P4PASSWD=secret git p4 commit --preserve-user &&
> +		P4EDITOR="test-chmtime +5" P4USER=alice P4PASSWD=secret &&
> +		git p4 commit --preserve-user &&

I think this hunk is wrong; we need to either change && to \ to make
it a single logical line that exports three environment variables
only to "git p4 commit --preserve-user", or insert "export P4EDITOR
P4USER P4PASSWD &&" between these two lines.

The latter seems to be what the remainder of the test is doing, so
I'd fix this up to mimick them.

Sorry for not catching it in the earlier review.

Thanks.

> @@ -69,7 +70,7 @@ test_expect_success 'refuse to preserve users without perms' '
>  		git config git-p4.skipSubmitEditCheck true &&
>  		echo "username-noperms: a change by alice" >>file1 &&
>  		git commit --author "Alice <[email-masked]>" -m "perms: a change by alice" file1 &&
> -		P4EDITOR=touch P4USER=bob P4PASSWD=secret &&
> +		P4EDITOR="test-chmtime +5" P4USER=bob P4PASSWD=secret &&
>  		export P4EDITOR P4USER P4PASSWD &&
>  		test_must_fail git p4 commit --preserve-user &&
>  		! git diff --exit-code HEAD..p4/master