convert "oidcmp() != 0" to "!oideq()"
[gitweb.git] / sha1-file.c
index 56e5329caf23c50d783c88b4058363cc1d847d57..cc8a1963498c78ec56171f79c4c1c2d426bd12ba 100644 (file)
@@ -149,10 +149,10 @@ static struct cached_object *find_cached_object(const struct object_id *oid)
        struct cached_object *co = cached_objects;
 
        for (i = 0; i < cached_object_nr; i++, co++) {
-               if (!oidcmp(&co->oid, oid))
+               if (oideq(&co->oid, oid))
                        return co;
        }
-       if (!oidcmp(oid, the_hash_algo->empty_tree))
+       if (oideq(oid, the_hash_algo->empty_tree))
                return &empty_tree;
        return NULL;
 }
@@ -825,7 +825,7 @@ int check_object_signature(const struct object_id *oid, void *map,
 
        if (map) {
                hash_object_file(map, size, type, &real_oid);
-               return oidcmp(oid, &real_oid) ? -1 : 0;
+               return !oideq(oid, &real_oid) ? -1 : 0;
        }
 
        st = open_istream(oid, &obj_type, &size, NULL);
@@ -852,7 +852,7 @@ int check_object_signature(const struct object_id *oid, void *map,
        }
        the_hash_algo->final_fn(real_oid.hash, &c);
        close_istream(st);
-       return oidcmp(oid, &real_oid) ? -1 : 0;
+       return !oideq(oid, &real_oid) ? -1 : 0;
 }
 
 int git_open_cloexec(const char *name, int flags)
@@ -1671,7 +1671,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,
                die(_("deflateEnd on object %s failed (%d)"), oid_to_hex(oid),
                    ret);
        the_hash_algo->final_fn(parano_oid.hash, &c);
-       if (oidcmp(oid, &parano_oid) != 0)
+       if (!oideq(oid, &parano_oid))
                die(_("confused by unstable object source data for %s"),
                    oid_to_hex(oid));
 
@@ -1860,7 +1860,7 @@ static int index_stream_convert_blob(struct object_id *oid, int fd,
        struct strbuf sbuf = STRBUF_INIT;
 
        assert(path);
-       assert(would_convert_to_git_filter_fd(path));
+       assert(would_convert_to_git_filter_fd(&the_index, path));
 
        convert_to_git_filter_fd(&the_index, path, fd, &sbuf,
                                 get_conv_flags(flags));
@@ -1950,7 +1950,7 @@ int index_fd(struct object_id *oid, int fd, struct stat *st,
         * Call xsize_t() only when needed to avoid potentially unnecessary
         * die() for large files.
         */
-       if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(path))
+       if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(&the_index, path))
                ret = index_stream_convert_blob(oid, fd, path, flags);
        else if (!S_ISREG(st->st_mode))
                ret = index_pipe(oid, fd, type, path, flags);