init_tree_desc(&t, args->tree->buffer, args->tree->size);
if (unpack_trees(1, &t, &opts))
return -1;
- git_attr_set_direction(GIT_ATTR_INDEX, &the_index);
+ git_attr_set_direction(GIT_ATTR_INDEX);
}
err = read_tree_recursive(args->tree, "", 0, 0, &args->pathspec,
* another thread could potentially be calling into the attribute system.
*/
static enum git_attr_direction direction;
-static const struct index_state *use_index;
-void git_attr_set_direction(enum git_attr_direction new_direction,
- const struct index_state *istate)
+void git_attr_set_direction(enum git_attr_direction new_direction)
{
if (is_bare_repository() && new_direction != GIT_ATTR_INDEX)
BUG("non-INDEX attr direction in a bare repo");
drop_all_attr_stacks();
direction = new_direction;
- use_index = istate;
}
static struct attr_stack *read_attr_from_file(const char *path, int macro_ok)
struct attr_stack *res;
char *buf, *sp;
int lineno = 0;
- const struct index_state *to_read_from;
- /*
- * Temporary workaround for c24f3abace (apply: file commited
- * with CRLF should roundtrip diff and apply - 2017-08-19)
- */
- to_read_from = use_index ? use_index : istate;
- if (!to_read_from)
+ if (!istate)
return NULL;
- buf = read_blob_data_from_index(to_read_from, path, NULL);
+ buf = read_blob_data_from_index(istate, path, NULL);
if (!buf)
return NULL;
GIT_ATTR_CHECKOUT,
GIT_ATTR_INDEX
};
-void git_attr_set_direction(enum git_attr_direction new_direction,
- const struct index_state *istate);
+void git_attr_set_direction(enum git_attr_direction new_direction);
void attr_start(void);
}
if (cached_attrs)
- git_attr_set_direction(GIT_ATTR_INDEX, NULL);
+ git_attr_set_direction(GIT_ATTR_INDEX);
doubledash = -1;
for (i = 0; doubledash < 0 && i < argc; i++) {
progress = get_progress(o);
if (o->update)
- git_attr_set_direction(GIT_ATTR_CHECKOUT, index);
+ git_attr_set_direction(GIT_ATTR_CHECKOUT);
if (should_update_submodules() && o->update && !o->dry_run)
load_gitmodules_file(index, NULL);
stop_progress(&progress);
errs |= finish_delayed_checkout(&state);
if (o->update)
- git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
+ git_attr_set_direction(GIT_ATTR_CHECKIN);
return errs != 0;
}