]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/transport-helper-error-reporting-fix' into fc/makefile
authorJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2013 23:15:32 +0000 (16:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2013 23:15:32 +0000 (16:15 -0700)
* js/transport-helper-error-reporting-fix:
  git-remote-testgit: build it to run under $SHELL_PATH
  git-remote-testgit: further remove some bashisms
  git-remote-testgit: avoid process substitution
  t5801: "VAR=VAL shell_func args" is forbidden
  transport-helper: update remote helper namespace
  transport-helper: trivial code shuffle
  transport-helper: warn when refspec is not used
  transport-helper: clarify pushing without refspecs
  transport-helper: update refspec documentation
  transport-helper: clarify *:* refspec
  transport-helper: improve push messages
  transport-helper: mention helper name when it dies
  transport-helper: report errors properly

Conflicts:
t/t5801-remote-helpers.sh

1  2 
Documentation/gitremote-helpers.txt
Makefile
git-remote-testgit.sh
t/t5801-remote-helpers.sh
transport-helper.c

Simple merge
diff --cc Makefile
Simple merge
Simple merge
index dbb02e2afd16b2ca53f18107f5f07af37f217c9b,0a83db8875cc221906ce292dd6247a0323ac6348..61479c3b16841c13798486590c56f265d821176c
@@@ -6,13 -6,7 +6,8 @@@
  test_description='Test remote-helper import and export commands'
  
  . ./test-lib.sh
 +. "$TEST_DIRECTORY"/lib-gpg.sh
  
- if ! type "${BASH-bash}" >/dev/null 2>&1; then
-       skip_all='skipping remote-testgit tests, bash not available'
-       test_done
- fi
  compare_refs() {
        git --git-dir="$1/.git" rev-parse --verify $2 >expect &&
        git --git-dir="$3/.git" rev-parse --verify $4 >actual &&
@@@ -167,25 -150,38 +151,57 @@@ test_expect_success 'push ref with exis
        compare_refs local dup server dup
  '
  
 +test_expect_success GPG 'push signed tag' '
 +      (cd local &&
 +      git checkout master &&
 +      git tag -s -m signed-tag signed-tag &&
 +      git push origin signed-tag
 +      ) &&
 +      compare_refs local signed-tag^{} server signed-tag^{} &&
 +      test_must_fail compare_refs local signed-tag server signed-tag
 +'
 +
 +test_expect_success GPG 'push signed tag with signed-tags capability' '
 +      (cd local &&
 +      git checkout master &&
 +      git tag -s -m signed-tag signed-tag-2 &&
 +      GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
 +      ) &&
 +      compare_refs local signed-tag-2 server signed-tag-2
 +'
 +
+ test_expect_success 'push update refs' '
+       (cd local &&
+       git checkout -b update master &&
+       echo update >>file &&
+       git commit -a -m update &&
+       git push origin update
+       git rev-parse --verify remotes/origin/update >expect &&
+       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 &&
+       cd local &&
+       test_must_fail git fetch 2> error &&
+       cat error &&
+       grep -q "Error while running fast-import" error
+       )
+ '
+ test_expect_success 'proper failure checks for pushing' '
+       (GIT_REMOTE_TESTGIT_FAILURE=1 &&
+       export GIT_REMOTE_TESTGIT_FAILURE &&
+       cd local &&
+       test_must_fail git push --all 2> error &&
+       cat error &&
+       grep -q "Reading from helper .git-remote-testgit. failed" error
+       )
+ '
  test_expect_success 'push messages' '
        (cd local &&
        git checkout -b new_branch master &&
index 522d79178e2cc4909a5df21fe483946fc3d1ad0e,92174095eda4f2446f97bdb2854e533080c0c834..f11d78a55a675ea2ea6dca0818ef796ae7fc74e3
@@@ -214,9 -212,12 +215,11 @@@ static struct child_process *get_helper
                int i;
                data->refspec_nr = refspec_nr;
                data->refspecs = parse_fetch_refspec(refspec_nr, refspecs);
 -              for (i = 0; i < refspec_nr; i++) {
 +              for (i = 0; i < refspec_nr; i++)
                        free((char *)refspecs[i]);
 -              }
                free(refspecs);
+       } else if (data->import || data->bidi_import || data->export) {
+               warning("This remote helper should implement refspec capability.");
        }
        strbuf_release(&buf);
        if (debug)