mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 01:39:29 +00:00
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.
This commit is contained in:
parent
824f755f10
commit
1a90b1e3f1
@ -241,3 +241,20 @@ void test_refs_branches_move__default_reflog_message(void)
|
||||
git_reflog_free(log);
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user