hook: use correct logical variable
[gitweb.git] / convert.c
index c09242cec0b1327c307b1b5a28f43f78c8e7886d..7d2a519dafe5dcf892df10c51e1bfb83bc8a2091 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,4 +1,6 @@
+#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
+#include "config.h"
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
@@ -1084,7 +1086,8 @@ const char *get_convert_attr_ascii(const char *path)
        return "";
 }
 
-int convert_to_git(const char *path, const char *src, size_t len,
+int convert_to_git(const struct index_state *istate,
+                  const char *path, const char *src, size_t len,
                    struct strbuf *dst, enum safe_crlf checksafe)
 {
        int ret = 0;
@@ -1100,7 +1103,7 @@ int convert_to_git(const char *path, const char *src, size_t len,
                src = dst->buf;
                len = dst->len;
        }
-       ret |= crlf_to_git(&the_index, path, src, len, dst, ca.crlf_action, checksafe);
+       ret |= crlf_to_git(istate, path, src, len, dst, ca.crlf_action, checksafe);
        if (ret && dst) {
                src = dst->buf;
                len = dst->len;
@@ -1164,14 +1167,15 @@ int convert_to_working_tree(const char *path, const char *src, size_t len, struc
        return convert_to_working_tree_internal(path, src, len, dst, 0);
 }
 
-int renormalize_buffer(const char *path, const char *src, size_t len, struct strbuf *dst)
+int renormalize_buffer(const struct index_state *istate, const char *path,
+                      const char *src, size_t len, struct strbuf *dst)
 {
        int ret = convert_to_working_tree_internal(path, src, len, dst, 1);
        if (ret) {
                src = dst->buf;
                len = dst->len;
        }
-       return ret | convert_to_git(path, src, len, dst, SAFE_CRLF_RENORMALIZE);
+       return ret | convert_to_git(istate, path, src, len, dst, SAFE_CRLF_RENORMALIZE);
 }
 
 /*****************************************************************