From 6d1bad3170d703e588030a952b04e33c040b234d Mon Sep 17 00:00:00 2001 From: Richard Xia Date: Tue, 9 Jun 2020 22:52:11 -0700 Subject: [PATCH] Add test for unicode branch names. --- t/unicode_branch_name.t | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 t/unicode_branch_name.t diff --git a/t/unicode_branch_name.t b/t/unicode_branch_name.t new file mode 100755 index 0000000..688540d --- /dev/null +++ b/t/unicode_branch_name.t @@ -0,0 +1,32 @@ +#!/bin/sh + +. $(dirname $0)/test_util.sh + +prereq on + +# Set up repo foo +make_repo 'foo' +foo_commit=$(git -C foo rev-parse HEAD) +git -C foo branch 💣 + +# Create new commit such that HEAD isn't the commit we want, since that's +# necessary for forcing wit into executing git show-ref, which is what triggers +# the error. +echo $RANDOM > foo/file +git -C foo add -A +git -C foo commit -m "commit2" + +# Set locale to ASCII (non-UTF-8) encoding. +export LANG=C +export LC_ALL=C + +prereq off + +wit init myws -a $PWD/foo::💣 +cd myws + +foo_ws_commit=$(git -C foo rev-parse HEAD) +check "foo commit should match the dependency" [ "$foo_ws_commit" = "$foo_commit" ] + +report +finish