[PATCH] i18n: use test_i18ncmp in t2020 (checkout --detach)

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

 



When v1.7.5-rc0~19^2~1 (checkout: clear commit marks after detached-orphan
check, 2011-03-20) added a check that the human-readable message

	Your branch is behind 'master' by 1 commit, and can be fast-forwarded.

is not suppressed by a previous commit walk, it forgot that the
message might be different when git is configured to write output in
another language.  Skip the output check in that case.

With this patch applied, the test passes with GETTEXT_POISON=true again.

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
Hi,

Jeff King wrote:

> When leaving a detached HEAD, we do a revision walk to make
> sure the commit we are leaving isn't being orphaned.
> However, this leaves crufty marks in the commit objects
> which can confuse later walkers, like the one in
> stat_tracking_info.
>
> Let's clean up after ourselves to prevent this conflict.

Very nice thing to do.  Thanks.

[...]
> --- a/t/t2020-checkout-detach.sh
> +++ b/t/t2020-checkout-detach.sh
> @@ -126,4 +126,17 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
>  	check_no_orphan_warning stderr
>  '
>
> +cat >expect <<'EOF'
> +Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
> +EOF
> +test_expect_success 'tracking count is accurate after orphan check' '
> +	reset &&
> +	git branch child master^ &&
> +	git config branch.child.remote . &&
> +	git config branch.child.merge refs/heads/master &&
> +	git checkout child^ &&
> +	git checkout child >stdout &&
> +	test_cmp expect stdout

Should use test_i18ncmp to handle people who force tests to run in
other locales (like the fake GETTEXT_POISON locale).  Quick patch
follows.

 t/t2020-checkout-detach.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 068fba4c..b37ce25c 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -148,7 +148,7 @@ test_expect_success 'tracking count is accurate after orphan check' '
 	git config branch.child.merge refs/heads/master &&
 	git checkout child^ &&
 	git checkout child >stdout &&
-	test_cmp expect stdout
+	test_i18ncmp expect stdout
 '
 
 test_done
-- 
1.7.10

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