subtree: make --ignore-joins pay attention to adds
[gitweb.git] / object.c
index b0faab85d40ae8a04cc219085d1b70531f179c82..e54160550c5a8e864f2e2bbcc58a29ff73045f8f 100644 (file)
--- a/object.c
+++ b/object.c
@@ -9,6 +9,7 @@
 #include "alloc.h"
 #include "object-store.h"
 #include "packfile.h"
+#include "commit-graph.h"
 
 unsigned int get_max_object_index(void)
 {
@@ -50,7 +51,7 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)
        if (gentle)
                return -1;
 
-       die("invalid object type \"%s\"", str);
+       die(_("invalid object type \"%s\""), str);
 }
 
 /*
@@ -94,7 +95,7 @@ struct object *lookup_object(struct repository *r, const unsigned char *sha1)
 
        first = i = hash_obj(sha1, r->parsed_objects->obj_hash_size);
        while ((obj = r->parsed_objects->obj_hash[i]) != NULL) {
-               if (!hashcmp(sha1, obj->oid.hash))
+               if (hasheq(sha1, obj->oid.hash))
                        break;
                i++;
                if (i == r->parsed_objects->obj_hash_size)
@@ -169,7 +170,7 @@ void *object_as_type(struct repository *r, struct object *obj, enum object_type
        }
        else {
                if (!quiet)
-                       error("object %s is a %s, not a %s",
+                       error(_("object %s is a %s, not a %s"),
                              oid_to_hex(&obj->oid),
                              type_name(obj->type), type_name(type));
                return NULL;
@@ -229,7 +230,7 @@ struct object *parse_object_buffer(struct repository *r, const struct object_id
                        obj = &tag->object;
                }
        } else {
-               warning("object %s has unknown type id %d", oid_to_hex(oid), type);
+               warning(_("object %s has unknown type id %d"), oid_to_hex(oid), type);
                obj = NULL;
        }
        return obj;
@@ -262,7 +263,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
            (!obj && has_object_file(oid) &&
             oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
                if (check_object_signature(repl, NULL, 0, NULL) < 0) {
-                       error("sha1 mismatch %s", oid_to_hex(oid));
+                       error(_("sha1 mismatch %s"), oid_to_hex(oid));
                        return NULL;
                }
                parse_blob_buffer(lookup_blob(r, oid), NULL, 0);
@@ -273,7 +274,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
        if (buffer) {
                if (check_object_signature(repl, buffer, size, type_name(type)) < 0) {
                        free(buffer);
-                       error("sha1 mismatch %s", oid_to_hex(repl));
+                       error(_("sha1 mismatch %s"), oid_to_hex(repl));
                        return NULL;
                }
 
@@ -507,6 +508,10 @@ void raw_object_store_clear(struct raw_object_store *o)
        oidmap_free(o->replace_map, 1);
        FREE_AND_NULL(o->replace_map);
 
+       free_commit_graph(o->commit_graph);
+       o->commit_graph = NULL;
+       o->commit_graph_attempted = 0;
+
        free_alt_odbs(o);
        o->alt_odb_tail = NULL;