Merge branch 'al/send-email-auto-cte-fixup'
[gitweb.git] / attr.c
diff --git a/attr.c b/attr.c
index 863fad3bd159152963b5cd91f4ef90d12769b34c..60d284796de728f59b839865eb035e1289a1a060 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -708,10 +708,8 @@ static struct attr_stack *read_attr_from_array(const char **list)
  * 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");
@@ -720,7 +718,6 @@ void git_attr_set_direction(enum git_attr_direction new_direction,
                drop_all_attr_stacks();
 
        direction = new_direction;
-       use_index = istate;
 }
 
 static struct attr_stack *read_attr_from_file(const char *path, int macro_ok)
@@ -750,17 +747,11 @@ static struct attr_stack *read_attr_from_index(const struct index_state *istate,
        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;
 
@@ -1152,9 +1143,9 @@ static void collect_some_attrs(const struct index_state *istate,
        fill(path, pathlen, basename_offset, check->stack, check->all_attrs, rem);
 }
 
-int git_check_attr(const struct index_state *istate,
-                  const char *path,
-                  struct attr_check *check)
+void git_check_attr(const struct index_state *istate,
+                   const char *path,
+                   struct attr_check *check)
 {
        int i;
 
@@ -1167,8 +1158,6 @@ int git_check_attr(const struct index_state *istate,
                        value = ATTR__UNSET;
                check->items[i].value = value;
        }
-
-       return 0;
 }
 
 void git_all_attrs(const struct index_state *istate,