diff options
author | Stefan Beller <sbeller@google.com> | 2018-05-17 15:51:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-18 08:13:10 +0900 |
commit | c88134870e8b2da084e37fb86ff88fb7d7617d61 (patch) | |
tree | ccc6e0b810e3e986d69652538b05dfe24c0c0a35 /fetch-pack.c | |
parent | 22bdc7c4ff28452283c150b627ed12a6ee370532 (diff) | |
download | git-c88134870e8b2da084e37fb86ff88fb7d7617d61.tar.gz |
shallow: add repository argument to is_repository_shallow
Add a repository argument to allow callers of is_repository_shallow
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.
As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index e3e99e4496..90befd370f 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -397,7 +397,7 @@ static int find_common(struct fetch_pack_args *args, return 1; } - if (is_repository_shallow()) + if (is_repository_shallow(the_repository)) write_shallow_commits(&req_buf, 1, NULL); if (args->depth > 0) packet_buf_write(&req_buf, "deepen %d", args->depth); @@ -986,7 +986,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, sort_ref_list(&ref, ref_compare_name); QSORT(sought, nr_sought, cmp_ref_by_name); - if ((args->depth > 0 || is_repository_shallow()) && !server_supports("shallow")) + if ((args->depth > 0 || is_repository_shallow(the_repository)) && !server_supports("shallow")) die(_("Server does not support shallow clients")); if (args->depth > 0 || args->deepen_since || args->deepen_not) args->deepen = 1; |