Re: [PATCH 2/2] transport-helper: fix remote helper namespace regression

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/2] transport-helper: fix remote helper namespace regression

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

Felipe Contreras [off-list ref] writes:
+test_expect_success 'push update refs failure' '
+	(cd local &&
+	git checkout update &&
+	echo "update fail" >>file &&
+	git commit -a -m "update fail" &&
+	git rev-parse --verify testgit/origin/heads/update >expect &&
+	GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" \
+	test_expect_code 1 git push origin update &&
This is not portable; as the remainder of this subshell does not
mind having the environment, a simple fix may be something like:

	GIT_REMOTE_TESTGIT_PUSH_ERROR="..." &&
        exoprt GIT_REMOTE_TESTGIT_PUSH_ERROR &&
        test_expect_code 1 git push ... &&
quoted hunk
+	git rev-parse --verify testgit/origin/heads/update >actual &&
+	test_cmp expect actual
+	)
+'
+
 test_expect_success 'proper failure checks for fetching' '
 	(GIT_REMOTE_TESTGIT_FAILURE=1 &&
 	export GIT_REMOTE_TESTGIT_FAILURE &&
diff --git a/transport-helper.c b/transport-helper.c
index f11d78a..2f5ac3f 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -705,7 +705,7 @@ static int push_update_ref_status(struct strbuf *buf,
 
 	(*ref)->status = status;
 	(*ref)->remote_status = msg;
-	return 0;
+	return !(status == REF_STATUS_OK);
 }
 
 static void push_update_refs_status(struct helper_data *data,

Re: [PATCH 2/2] transport-helper: fix remote helper namespace regression

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:12

On Fri, May 10, 2013 at 3:28 PM, Junio C Hamano [off-list ref] wrote:
Felipe Contreras [off-list ref] writes:
quoted
+test_expect_success 'push update refs failure' '
+     (cd local &&
+     git checkout update &&
+     echo "update fail" >>file &&
+     git commit -a -m "update fail" &&
+     git rev-parse --verify testgit/origin/heads/update >expect &&
+     GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" \
+     test_expect_code 1 git push origin update &&
This is not portable
Why not? Other parts of this script run commands with environment
variables like this.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help