diff options
author | Russell Belfer <rb@github.com> | 2013-10-01 03:58:33 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-10-03 21:44:13 +0400 |
commit | 2fe54afa2a8f87d03d2d550dcde7718f27e40967 (patch) | |
tree | 262b9bcbe9ccf920f84ee1e7aa8d51d352850ead /src/refdb_fs.c | |
parent | 6b7991e264b2fb0448e3dc47f972bafabf38c1fa (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/refdb_fs.c')
-rw-r--r-- | src/refdb_fs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c index 0ba711eb7..715b311a4 100644 --- a/src/refdb_fs.c +++ b/src/refdb_fs.c @@ -458,17 +458,23 @@ static void refdb_fs_backend__iterator_free(git_reference_iterator *_iter) static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter) { - int error = 0; + int error = 0, t; git_buf path = GIT_BUF_INIT; + git_iterator_flag_t flags = 0; git_iterator *fsit = NULL; const git_index_entry *entry = NULL; if (!backend->path) /* do nothing if no path for loose refs */ return 0; + if (!git_repository__cvar(&t, backend->repo, GIT_CVAR_IGNORECASE) && t) + flags |= GIT_ITERATOR_IGNORE_CASE; + if (!git_repository__cvar(&t, backend->repo, GIT_CVAR_PRECOMPOSE) && t) + flags |= GIT_ITERATOR_PRECOMPOSE_UNICODE; + if ((error = git_buf_printf(&path, "%s/refs", backend->path)) < 0 || (error = git_iterator_for_filesystem( - &fsit, git_buf_cstr(&path), 0, NULL, NULL)) < 0) { + &fsit, git_buf_cstr(&path), flags, NULL, NULL)) < 0) { git_buf_free(&path); return error; } |