Commit 1a90b1e3 by Arthur Schreiber

Refs: Add a unicode test for git_branch_move.

This tests that decomposed branch names are correctly precomposed when
passed to `git_branch_move` and `core.precomposeunicode` is enabled.
parent 824f755f
...@@ -241,3 +241,20 @@ void test_refs_branches_move__default_reflog_message(void) ...@@ -241,3 +241,20 @@ void test_refs_branches_move__default_reflog_message(void)
git_reflog_free(log); git_reflog_free(log);
git_signature_free(sig); git_signature_free(sig);
} }
void test_refs_branches_move__can_move_with_unicode(void)
{
git_reference *original_ref, *new_ref;
const char *new_branch_name = "\x41\xCC\x8A\x73\x74\x72\x6F\xCC\x88\x6D";
cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2"));
cl_git_pass(git_branch_move(&new_ref, original_ref, new_branch_name, 0, NULL, NULL));
if (cl_repo_get_bool(repo, "core.precomposeunicode"))
cl_assert_equal_s(GIT_REFS_HEADS_DIR "\xC3\x85\x73\x74\x72\xC3\xB6\x6D", git_reference_name(new_ref));
else
cl_assert_equal_s(GIT_REFS_HEADS_DIR "\x41\xCC\x8A\x73\x74\x72\x6F\xCC\x88\x6D", git_reference_name(new_ref));
git_reference_free(original_ref);
git_reference_free(new_ref);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment