summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/checkout.c b/src/checkout.c
index d5a471d0c..411bf3be7 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -224,7 +224,7 @@ static int checkout_action_wd_only(
if (!git_pathspec_match_path(
pathspec, wd->path,
(data->strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH) != 0,
- workdir->ignore_case))
+ git_iterator_ignore_case(workdir)))
return 0;
/* check if item is tracked in the index but not in the checkout diff */
@@ -1130,7 +1130,7 @@ static int checkout_data_init(
if ((error = git_config_refresh(cfg)) < 0)
goto cleanup;
- if (git_iterator_inner_type(target) == GIT_ITERATOR_INDEX) {
+ if (git_iterator_inner_type(target) == GIT_ITERATOR_TYPE_INDEX) {
/* if we are iterating over the index, don't reload */
data->index = git_iterator_index_get_index(target);
GIT_REFCOUNT_INC(data->index);
@@ -1208,6 +1208,7 @@ int git_checkout_iterator(
git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT;
uint32_t *actions = NULL;
size_t *counts = NULL;
+ git_iterator_flag_t iterflags = 0;
/* initialize structures and options */
error = checkout_data_init(&data, target, opts);
@@ -1228,18 +1229,21 @@ int git_checkout_iterator(
diff_opts.pathspec = data.opts.paths;
/* set up iterators */
+
+ iterflags = git_iterator_ignore_case(target) ?
+ GIT_ITERATOR_IGNORE_CASE : GIT_ITERATOR_DONT_IGNORE_CASE;
+
if ((error = git_iterator_reset(target, data.pfx, data.pfx)) < 0 ||
(error = git_iterator_for_workdir_range(
- &workdir, data.repo, data.pfx, data.pfx)) < 0 ||
+ &workdir, data.repo, iterflags, data.pfx, data.pfx)) < 0 ||
(error = git_iterator_for_tree_range(
- &baseline, data.opts.baseline, data.pfx, data.pfx)) < 0)
+ &baseline, data.opts.baseline, iterflags, data.pfx, data.pfx)) < 0)
goto cleanup;
/* Handle case insensitivity for baseline if necessary */
- if (workdir->ignore_case && !baseline->ignore_case) {
+ if (git_iterator_ignore_case(workdir) != git_iterator_ignore_case(baseline))
if ((error = git_iterator_spoolandsort_push(baseline, true)) < 0)
goto cleanup;
- }
/* Generate baseline-to-target diff which will include an entry for
* every possible update that might need to be made.