apply.h: drop extern on func declaration
[gitweb.git] / fast-import.c
index 34edf3fb8f9012bf2fcaf231604ebb490e66940c..89bb0c9db3de9b380aad53709d882cb04f7d054a 100644 (file)
@@ -1076,7 +1076,7 @@ static int store_object(
                return 1;
        }
 
-       if (last && last->data.buf && last->depth < max_depth
+       if (last && last->data.len && last->data.buf && last->depth < max_depth
                && dat->len > the_hash_algo->rawsz) {
 
                delta_count_attempts_by_type[type]++;
@@ -1331,7 +1331,7 @@ static void *gfi_unpack_entry(
                 */
                p->pack_size = pack_size + the_hash_algo->rawsz;
        }
-       return unpack_entry(p, oe->idx.offset, &type, sizep);
+       return unpack_entry(the_repository, p, oe->idx.offset, &type, sizep);
 }
 
 static const char *get_mode(const char *str, uint16_t *modep)
@@ -1724,8 +1724,10 @@ static int update_branch(struct branch *b)
        if (!force_update && !is_null_oid(&old_oid)) {
                struct commit *old_cmit, *new_cmit;
 
-               old_cmit = lookup_commit_reference_gently(&old_oid, 0);
-               new_cmit = lookup_commit_reference_gently(&b->oid, 0);
+               old_cmit = lookup_commit_reference_gently(the_repository,
+                                                         &old_oid, 0);
+               new_cmit = lookup_commit_reference_gently(the_repository,
+                                                         &b->oid, 0);
                if (!old_cmit || !new_cmit)
                        return error("Branch %s is missing commits.", b->name);
 
@@ -1817,7 +1819,7 @@ static void dump_marks_helper(FILE *f,
 
 static void dump_marks(void)
 {
-       static struct lock_file mark_lock;
+       struct lock_file mark_lock = LOCK_INIT;
        FILE *f;
 
        if (!export_marks_file || (import_marks_file && !import_marks_file_done))
@@ -1872,7 +1874,8 @@ static void read_marks(void)
                        die("corrupt mark line: %s", line);
                e = find_object(&oid);
                if (!e) {
-                       enum object_type type = oid_object_info(&oid, NULL);
+                       enum object_type type = oid_object_info(the_repository,
+                                                               &oid, NULL);
                        if (type < 0)
                                die("object not found: %s", oid_to_hex(&oid));
                        e = insert_object(&oid);
@@ -2402,7 +2405,8 @@ static void file_change_m(const char *p, struct branch *b)
                enum object_type expected = S_ISDIR(mode) ?
                                                OBJ_TREE: OBJ_BLOB;
                enum object_type type = oe ? oe->type :
-                                       oid_object_info(&oid, NULL);
+                                       oid_object_info(the_repository, &oid,
+                                                       NULL);
                if (type < 0)
                        die("%s not found: %s",
                                        S_ISDIR(mode) ?  "Tree" : "Blob",
@@ -2563,7 +2567,8 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
                        die("Not a blob (actually a %s): %s",
                                type_name(oe->type), command_buf.buf);
        } else if (!is_null_oid(&oid)) {
-               enum object_type type = oid_object_info(&oid, NULL);
+               enum object_type type = oid_object_info(the_repository, &oid,
+                                                       NULL);
                if (type < 0)
                        die("Blob not found: %s", command_buf.buf);
                if (type != OBJ_BLOB)
@@ -2850,7 +2855,7 @@ static void parse_new_tag(const char *arg)
        } else if (!get_oid(from, &oid)) {
                struct object_entry *oe = find_object(&oid);
                if (!oe) {
-                       type = oid_object_info(&oid, NULL);
+                       type = oid_object_info(the_repository, &oid, NULL);
                        if (type < 0)
                                die("Not a valid object: %s", from);
                } else
@@ -3008,7 +3013,8 @@ static struct object_entry *dereference(struct object_entry *oe,
        unsigned long size;
        char *buf = NULL;
        if (!oe) {
-               enum object_type type = oid_object_info(oid, NULL);
+               enum object_type type = oid_object_info(the_repository, oid,
+                                                       NULL);
                if (type < 0)
                        die("object not found: %s", oid_to_hex(oid));
                /* cache it! */