request-pull: quote regex metacharacters in local ref
[gitweb.git] / builtin / difftool.c
index cdd585ca76d51f6d5dcca78a9e1dfa6f8102c476..a3ea60ea71428ee59ab20a67f6e9ccf76c841f85 100644 (file)
@@ -11,6 +11,7 @@
  *
  * Copyright (C) 2016 Johannes Schindelin
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
@@ -112,11 +113,11 @@ static int use_wt_file(const char *workdir, const char *name,
                int fd = open(buf.buf, O_RDONLY);
 
                if (fd >= 0 &&
-                   !index_fd(&wt_oid, fd, &st, OBJ_BLOB, name, 0)) {
+                   !index_fd(&the_index, &wt_oid, fd, &st, OBJ_BLOB, name, 0)) {
                        if (is_null_oid(oid)) {
                                oidcpy(oid, &wt_oid);
                                use = 1;
-                       } else if (!oidcmp(oid, &wt_oid))
+                       } else if (oideq(oid, &wt_oid))
                                use = 1;
                }
        }
@@ -323,7 +324,7 @@ static int checkout_path(unsigned mode, struct object_id *oid,
        int ret;
 
        ce = make_transient_cache_entry(mode, oid, path, 0);
-       ret = checkout_entry(ce, state, NULL);
+       ret = checkout_entry(ce, state, NULL, NULL);
 
        discard_cache_entry(ce);
        return ret;
@@ -438,7 +439,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
                        strbuf_reset(&buf);
                        strbuf_addf(&buf, "Subproject commit %s",
                                    oid_to_hex(&roid));
-                       if (!oidcmp(&loid, &roid))
+                       if (oideq(&loid, &roid))
                                strbuf_addstr(&buf, "-dirty");
                        add_left_or_right(&submodules, dst_path, buf.buf, 1);
                        continue;