tests: stabilize `test-clonebundles.t` on Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 07 Oct 2024 18:26:41 -0400
changeset 51987 d8b981968a55
parent 51986 92a708af7b05
child 51988 df887ca0d891
tests: stabilize `test-clonebundles.t` on Windows The `remote: {foo,bar}` lines were different because `echo` in MSYS uses `\r\n`. I couldn't make it work with the previous echoing of individual lines, changing the internal `echo` to `printf "foo\n"`, because that output as "foon". This works on Linux and Windows, so I'm not thinking too hard about it.
tests/test-clonebundles.t
--- a/tests/test-clonebundles.t	Mon Oct 07 17:26:31 2024 -0400
+++ b/tests/test-clonebundles.t	Mon Oct 07 18:26:41 2024 -0400
@@ -290,8 +290,10 @@
 Hooks work with inline bundle
 
   $ cp server/.hg/hgrc server/.hg/hgrc-beforeinlinehooks
-  $ echo "[hooks]" >> server/.hg/hgrc
-  $ echo "pretransmit-inline-clone-bundle=echo foo" >> server/.hg/hgrc
+  $ cat >> server/.hg/hgrc <<-EOF
+  > [hooks]
+  > pretransmit-inline-clone-bundle=sh -c 'printf "foo\n"'
+  > EOF
   $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook
   applying clone bundle from peer-bundle-cache://full.hg
   remote: foo
@@ -307,8 +309,10 @@
 Hooks can make an inline bundle fail
 
   $ cp server/.hg/hgrc-beforeinlinehooks server/.hg/hgrc
-  $ echo "[hooks]" >> server/.hg/hgrc
-  $ echo "pretransmit-inline-clone-bundle=echo bar && false" >> server/.hg/hgrc
+  $ cat >> server/.hg/hgrc <<-EOF
+  > [hooks]
+  > pretransmit-inline-clone-bundle=sh -c 'printf "bar\n"' && false
+  > EOF
   $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook-fail
   applying clone bundle from peer-bundle-cache://full.hg
   remote: bar