use skip_prefix to avoid magic numbers
[gitweb.git] / builtin / unpack-objects.c
index f63973c9143c4109a3d1e40df9ec66a32498fe00..99cde45879401350355083f773a2ff2b78113d1a 100644 (file)
@@ -90,7 +90,7 @@ static void use(int bytes)
 
 static void *get_data(unsigned long size)
 {
-       z_stream stream;
+       git_zstream stream;
        void *buf = xmalloc(size);
 
        memset(&stream, 0, sizeof(stream));
@@ -107,7 +107,7 @@ static void *get_data(unsigned long size)
                if (stream.total_out == size && ret == Z_STREAM_END)
                        break;
                if (ret != Z_OK) {
-                       error("inflate returned %d\n", ret);
+                       error("inflate returned %d", ret);
                        free(buf);
                        buf = NULL;
                        if (!recover)
@@ -480,7 +480,7 @@ static void unpack_all(void)
        use(sizeof(struct pack_header));
 
        if (!quiet)
-               progress = start_progress("Unpacking objects", nr_objects);
+               progress = start_progress(_("Unpacking objects"), nr_objects);
        obj_list = xcalloc(nr_objects, sizeof(*obj_list));
        for (i = 0; i < nr_objects; i++) {
                unpack_one(i);
@@ -497,7 +497,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
        int i;
        unsigned char sha1[20];
 
-       read_replace_refs = 0;
+       check_replace_refs = 0;
 
        git_config(git_default_config, NULL);
 
@@ -523,7 +523,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
                                strict = 1;
                                continue;
                        }
-                       if (!prefixcmp(arg, "--pack_header=")) {
+                       if (starts_with(arg, "--pack_header=")) {
                                struct pack_header *hdr;
                                char *c;