From b2c851a8e67da752d8a5dbde5a9dae6e3428a4c9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 20 May 2014 14:18:11 -0700 Subject: Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)" Instead of showing a warning and working as before, fail and show the message and force immediate upgrade from their upstream repositories when these tools are run, per request from their primary author. Signed-off-by: Junio C Hamano --- t/t5801-remote-helpers.sh | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 't/t5801-remote-helpers.sh') diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 25fd2e7f4..a00a66076 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -212,19 +212,30 @@ test_expect_success 'push update refs failure' ' 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" && - export GIT_REMOTE_TESTGIT_PUSH_ERROR && - test_expect_code 1 git push origin update && + test_expect_code 1 env GIT_REMOTE_TESTGIT_FAILURE="non-fast forward" \ + git push origin update && git rev-parse --verify testgit/origin/heads/update >actual && test_cmp expect actual ) ' +clean_mark () { + cut -f 2 -d ' ' "$1" | + git cat-file --batch-check | + grep commit | + sort >$(basename "$1") +} + +cmp_marks () { + test_when_finished "rm -rf git.marks testgit.marks" && + clean_mark ".git/testgit/$1/git.marks" && + clean_mark ".git/testgit/$1/testgit.marks" && + test_cmp git.marks testgit.marks +} + test_expect_success 'proper failure checks for fetching' ' - (GIT_REMOTE_TESTGIT_FAILURE=1 && - export GIT_REMOTE_TESTGIT_FAILURE && - cd local && - test_must_fail git fetch 2> error && + (cd local && + test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error && cat error && grep -q "Error while running fast-import" error ) @@ -232,7 +243,11 @@ test_expect_success 'proper failure checks for fetching' ' test_expect_success 'proper failure checks for pushing' ' (cd local && - test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all + git checkout -b crash master && + echo crash >>file && + git commit -a -m crash && + test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all && + cmp_marks origin ) ' -- cgit v1.2.1