Merge branch 'sg/travis-retrieve-trash-upon-failure'
[gitweb.git] / convert.c
index e53911d4f835e087cf4c44a93307388bea9711fa..ce7ea0db067ea9fe48933b6d85397c64c80dea36 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,6 +1,7 @@
 #define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
+#include "object-store.h"
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
@@ -334,7 +335,7 @@ static void trace_encoding(const char *context, const char *path,
        strbuf_addf(&trace, "%s (%s, considered %s):\n", context, path, encoding);
        for (i = 0; i < len && buf; ++i) {
                strbuf_addf(
-                       &trace,"| \e[2m%2i:\e[0m %2x \e[2m%c\e[0m%c",
+                       &trace, "| \033[2m%2i:\033[0m %2x \033[2m%c\033[0m%c",
                        i,
                        (unsigned char) buf[i],
                        (buf[i] > 32 && buf[i] < 127 ? buf[i] : ' '),
@@ -389,7 +390,7 @@ static int encode_to_git(const char *path, const char *src, size_t src_len,
                         struct strbuf *buf, const char *enc, int conv_flags)
 {
        char *dst;
-       int dst_len;
+       size_t dst_len;
        int die_on_error = conv_flags & CONV_WRITE_OBJECT;
 
        /*
@@ -452,7 +453,7 @@ static int encode_to_git(const char *path, const char *src, size_t src_len,
         */
        if (die_on_error && check_roundtrip(enc)) {
                char *re_src;
-               int re_src_len;
+               size_t re_src_len;
 
                re_src = reencode_string_len(dst, dst_len,
                                             enc, default_encoding,
@@ -480,7 +481,7 @@ static int encode_to_worktree(const char *path, const char *src, size_t src_len,
                              struct strbuf *buf, const char *enc)
 {
        char *dst;
-       int dst_len;
+       size_t dst_len;
 
        /*
         * No encoding is specified or there is nothing to encode.