Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-10-01 03:58:33 +0400
committerRussell Belfer <rb@github.com>2013-10-03 21:44:13 +0400
commit2fe54afa2a8f87d03d2d550dcde7718f27e40967 (patch)
tree262b9bcbe9ccf920f84ee1e7aa8d51d352850ead /src/iterator.c
parent6b7991e264b2fb0448e3dc47f972bafabf38c1fa (diff)
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.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c14
1 files changed, 13 insertions, 1 deletions
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);
}