static struct lock_file lock;
 
-int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
+static void fetch_pack_setup(void)
 {
-       int i, ret, nr_heads;
-       struct ref *ref;
-       char *dest = NULL, **heads;
-
+       static int did_setup;
+       if (did_setup)
+               return;
        git_config(fetch_pack_config);
-
        if (0 <= transfer_unpack_limit)
                unpack_limit = transfer_unpack_limit;
        else if (0 <= fetch_unpack_limit)
                unpack_limit = fetch_unpack_limit;
+       did_setup = 1;
+}
+
+int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
+{
+       int i, ret, nr_heads;
+       struct ref *ref;
+       char *dest = NULL, **heads;
 
        nr_heads = 0;
        heads = NULL;
        struct ref *ref;
        struct stat st;
 
+       fetch_pack_setup();
        memcpy(&args, my_args, sizeof(args));
        if (args.depth > 0) {
                if (stat(git_path("shallow"), &st))
 
 struct git_transport_data {
        unsigned thin : 1;
        unsigned keep : 1;
-
-       int unpacklimit;
-
        int depth;
-
        const char *uploadpack;
        const char *receivepack;
 };
        } else if (!strcmp(name, TRANS_OPT_KEEP)) {
                data->keep = !!value;
                return 0;
-       } else if (!strcmp(name, TRANS_OPT_UNPACKLIMIT)) {
-               data->unpacklimit = atoi(value);
-               return 0;
        } else if (!strcmp(name, TRANS_OPT_DEPTH)) {
                if (!value)
                        data->depth = 0;
        args.uploadpack = data->uploadpack;
        args.keep_pack = data->keep;
        args.lock_pack = 1;
-       args.unpacklimit = data->unpacklimit;
        args.use_thin_pack = data->thin;
        args.verbose = transport->verbose;
        args.depth = data->depth;
                data->receivepack = "git-receive-pack";
                if (remote && remote->receivepack)
                        data->receivepack = remote->receivepack;
-               data->unpacklimit = -1;
        }
 
        return ret;
 
 /* Keep the pack that was transferred if not null */
 #define TRANS_OPT_KEEP "keep"
 
-/* Unpack the objects if fewer than this number of objects are fetched */
-#define TRANS_OPT_UNPACKLIMIT "unpacklimit"
-
 /* Limit the depth of the fetch if not null */
 #define TRANS_OPT_DEPTH "depth"