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

[PATCH 4/4] remote-hg: add tests for special filenames

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 7, 2013, 13:09 UTC
Message-ID
<1386421783-27781-5-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1386421783-27781-1-git-send-email-felipe.contreras@gmail.com>
So that we check that UTF-8 and spaces work fine.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/test-hg.sh | 68 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index 72f745d..56840ff 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -442,6 +442,74 @@ test_expect_success 'remote new bookmark multiple branch head' '
 # cleanup previous stuff
 rm -rf hgrepo
 
+test_expect_success 'fetch special filenames' '
+	test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
+
+	LC_ALL=en_US.UTF-8
+	export LC_ALL
+
+	(
+	hg init hgrepo &&
+	cd hgrepo &&
+
+	echo test >> "æ rø" &&
+	hg add "æ rø" &&
+	echo test >> "ø~?" &&
+	hg add "ø~?" &&
+	hg commit -m add-utf-8 &&
+	echo test >> "æ rø" &&
+	hg commit -m test-utf-8 &&
+	hg rm "ø~?" &&
+	hg mv "æ rø" "ø~?" &&
+	hg commit -m hg-mv-utf-8
+	) &&
+
+	(
+	git clone "hg::hgrepo" gitrepo &&
+	cd gitrepo &&
+	git -c core.quotepath=false ls-files > ../actual
+	) &&
+	echo "ø~?" > expected &&
+	test_cmp expected actual
+'
+
+test_expect_success 'push special filenames' '
+	test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
+
+	mkdir -p tmp && cd tmp &&
+
+	LC_ALL=en_US.UTF-8
+	export LC_ALL
+
+	(
+	hg init hgrepo &&
+	cd hgrepo &&
+
+	echo one >> content &&
+	hg add content &&
+	hg commit -m one
+	) &&
+
+	(
+	git clone "hg::hgrepo" gitrepo &&
+	cd gitrepo &&
+
+	echo test >> "æ rø" &&
+	git add "æ rø" &&
+	git commit -m utf-8 &&
+
+	git push
+	) &&
+
+	(cd hgrepo &&
+	hg update &&
+	hg manifest > ../actual
+	) &&
+
+	printf "content\næ rø\n" > expected &&
+	test_cmp expected actual
+'
+
 setup_big_push () {
 	(
 	hg init hgrepo &&
-- 
1.8.4.2+fc1
Previous: Antoine Pelisse
Message 8 of 8 in “remote-helpers: fixes”
  1. 0/4 remote-helpers: fixesFelipe Contreras, Dec 7, 2013
  2. 1/4 remote-hg: avoid buggy strftime()Felipe Contreras, Dec 7, 2013
  3. 2/4 remote-helpers: add extra safety checksFelipe Contreras, Dec 7, 2013
  4. 3/4 remote-hg: fix 'shared path' pathFelipe Contreras, Dec 7, 2013
  5. Antoine PelisseDec 13, 2013
  6. Junio C HamanoDec 17, 2013
  7. remote-hg: test 'shared_path' in a moved cloneAntoine Pelisse, Dec 23, 2013
  8. 4/4 remote-hg: add tests for special filenamesFelipe Contreras, Dec 7, 2013

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.