From 2fe54afa2a8f87d03d2d550dcde7718f27e40967 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Mon, 30 Sep 2013 16:58:33 -0700 Subject: Put hooks in place for precompose in dirload fn This doesn't actual do string precompose but it puts the hooks in place into the iterators and the git_path_dirload function so that the actual precompose work is ready to go. --- src/iterator.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/iterator.c') diff --git a/src/iterator.c b/src/iterator.c index bdc98d22b..946790449 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -986,7 +986,10 @@ static int fs_iterator__expand_dir(fs_iterator *fi) GITERR_CHECK_ALLOC(ff); error = git_path_dirload_with_stat( - fi->path.ptr, fi->root_len, iterator__ignore_case(fi), + fi->path.ptr, fi->root_len, + (iterator__ignore_case(fi) ? GIT_PATH_DIRLOAD_IGNORE_CASE : 0) | + (iterator__flag(fi, PRECOMPOSE_UNICODE) ? + GIT_PATH_DIRLOAD_PRECOMPOSE_UNICODE : 0), fi->base.start, fi->base.end, &ff->entries); if (error < 0) { @@ -1356,6 +1359,15 @@ int git_iterator_for_workdir_ext( return error; } + /* try to look up precompose and set flag if appropriate */ + { + int precompose = 0; + if (git_repository__cvar(&precompose, repo, GIT_CVAR_PRECOMPOSE) < 0) + giterr_clear(); + else if (precompose) + wi->fi.base.flags |= GIT_ITERATOR_PRECOMPOSE_UNICODE; + } + return fs_iterator__initialize(out, &wi->fi, repo_workdir); } -- cgit v1.2.3