git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 6/6] Add testcase to verify handling of missing remote helper programs

From
Johan Herland <johan@herland.net>
Date
Aug 11, 2009, 10:10 UTC
Message-ID
<1249985426-13726-7-git-send-email-johan@herland.net>
In-Reply-To
<alpine.LNX.2.00.0908101205120.27553@iabervon.org>
Signed-off-by: Johan Herland <johan@herland.net>
---
 t/t5590-remote-helper-missing.sh |   56 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100755 t/t5590-remote-helper-missing.sh
diff --git a/t/t5590-remote-helper-missing.sh b/t/t5590-remote-helper-missing.sh
new file mode 100755
index 0000000..3bc2bc2
--- /dev/null
+++ b/t/t5590-remote-helper-missing.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+test_description='test graceful failure when missing remote helper program'
+. ./test-lib.sh
+
+test_expect_success 'setup repository' '
+	echo content >file &&
+	git add file &&
+	git commit -m one &&
+	git config remote.missing.vcs foo &&
+	git remote add missing2 foo:/nonexisting/path
+'
+
+test_expect_success 'fetch changes from "missing" remote' '
+	cat <<EOF >expect &&
+warning: Could not find remote helper command "git remote-foo". Assuming native remote.
+EOF
+	! git fetch missing >actual 2>&1 &&
+	head -n1 actual >actual.first &&
+	test_cmp expect actual.first
+'
+
+test_expect_success 'fetch changes from "missing2" remote' '
+	cat <<EOF >expect &&
+warning: Could not find remote helper command "git remote-foo". Assuming native remote.
+EOF
+	! git fetch missing2 >actual 2>&1 &&
+	head -n1 actual >actual.first &&
+	test_cmp expect actual.first
+'
+
+test_expect_success 'push changes to "missing" remote' '
+	echo "more content" >>file &&
+	git add file &&
+	git commit -m two &&
+	cat <<EOF >expect &&
+warning: Could not find remote helper command "git remote-foo". Assuming native remote.
+EOF
+	! git push --all missing >actual 2>&1 &&
+	head -n1 actual >actual.first &&
+	test_cmp expect actual.first
+'
+
+test_expect_success 'push changes to "missing2" remote' '
+	echo "even more content" >>file &&
+	git add file &&
+	git commit -m three &&
+	cat <<EOF >expect &&
+warning: Could not find remote helper command "git remote-foo". Assuming native remote.
+EOF
+	! git push --all missing2 >actual 2>&1 &&
+	head -n1 actual >actual.first &&
+	test_cmp expect actual.first
+'
+
+test_done
-- 
1.6.4.rc3.138.ga6b98.dirty
Previous: Daniel BarkalowNext: Junio C Hamano
Message 21 of 35 in “Add a config option for remotes to specify a foreign vcs”
  1. 5/8 Add a config option for remotes to specify a foreign vcsDaniel Barkalow, Aug 9, 2009
  2. Johannes SchindelinAug 9, 2009
  3. Junio C HamanoAug 10, 2009
  4. Daniel BarkalowAug 10, 2009
  5. Johan HerlandAug 10, 2009
  6. Daniel BarkalowAug 10, 2009
  7. 0/6 Graceful handling of missing remote helpersJohan Herland, Aug 11, 2009
  8. 1/6 Minor unrelated fixesJohan Herland, Aug 11, 2009
  9. 2/6 transport_get(): Don't SEGFAULT on missing urlJohan Herland, Aug 11, 2009
  10. Junio C HamanoAug 12, 2009
  11. Johan HerlandAug 12, 2009
  12. 3/6 Move setup of curl remote helper from transport.c to transport-helper.cJohan Herland, Aug 11, 2009
  13. Johannes SchindelinAug 11, 2009
  14. 4/6 Add is_git_command_or_alias() for checking availability of a given git commandJohan Herland, Aug 11, 2009
  15. Johannes SchindelinAug 11, 2009
  16. 5/6 Let transport_helper_init() decide if a remote helper program can be usedJohan Herland, Aug 11, 2009
  17. Johannes SchindelinAug 11, 2009
  18. Daniel BarkalowAug 11, 2009
  19. Jeff KingAug 12, 2009
  20. Daniel BarkalowAug 12, 2009
  21. 6/6 Add testcase to verify handling of missing remote helper programsJohan Herland, Aug 11, 2009
  22. Junio C HamanoAug 11, 2009
  23. Johannes SchindelinAug 11, 2009
  24. Junio C HamanoAug 10, 2009
  25. Bert WesargAug 11, 2009
  26. Johannes SchindelinAug 11, 2009
  27. Jeff KingAug 11, 2009
  28. Johannes SchindelinAug 11, 2009
  29. Jeff KingAug 12, 2009
  30. Jakub NarebskiAug 12, 2009
  31. Junio C HamanoAug 12, 2009
  32. Jakub NarebskiAug 13, 2009
  33. Jeff KingAug 11, 2009
  34. Johannes SchindelinAug 12, 2009
  35. Junio C HamanoAug 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.