summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa74052)
raw | patch | inline | side by side (parent: fa74052)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 19 Sep 2007 04:49:39 +0000 (00:49 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700) |
The only way to configure the unpacking limit is currently through
the .git/config (or ~/.gitconfig) mechanism as we have no existing
command line option interface to control this threshold on a per
invocation basis. This was intentional by design as the storage
policy of the repository should be a repository-wide decision and
should not be subject to variations made on individual command
executions.
Earlier builtin-fetch was bypassing the unpacking limit chosen by
the user through the configuration file as it did not reread the
configuration options through fetch_pack_config if we called the
internal fetch_pack() API directly. We now ensure we always run the
config file through fetch_pack_config at least once in this process,
thereby setting our unpackLimit properly.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the .git/config (or ~/.gitconfig) mechanism as we have no existing
command line option interface to control this threshold on a per
invocation basis. This was intentional by design as the storage
policy of the repository should be a repository-wide decision and
should not be subject to variations made on individual command
executions.
Earlier builtin-fetch was bypassing the unpacking limit chosen by
the user through the configuration file as it did not reread the
configuration options through fetch_pack_config if we called the
internal fetch_pack() API directly. We now ensure we always run the
config file through fetch_pack_config at least once in this process,
thereby setting our unpackLimit properly.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c | patch | blob | history | |
transport.c | patch | blob | history | |
transport.h | patch | blob | history |
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 77eb181b5f3aba8dfd5dd40ae8c3349d78c75706..8f25d509a0b1bace78d0cb3f2a219b23e8b66d18 100644 (file)
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
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))
diff --git a/transport.c b/transport.c
index 85f5b1ed4cf5f9a97625606bba72143861920d0c..a1d0a3c89915e028d3e2c6f7e03612762234b960 100644 (file)
--- a/transport.c
+++ b/transport.c
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;
diff --git a/transport.h b/transport.h
index 3e332ff53ad95fb47fc39aea5ca1ae479d92672b..6e318e4e8c7ff8e345fd54cacf70fa615cf1920a 100644 (file)
--- a/transport.h
+++ b/transport.h
/* 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"