summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-29 17:24:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-29 17:43:28 (GMT)
commitb16b60f71b2354cbad5f2dc16bd5f6cf7d617579 (patch)
tree8afa4e7dd5c9277fb6a28f9b5e8813ff7aa069fb /fetch-pack.c
parente3331758f12da22f4103eec7efe1b5304a9be5e9 (diff)
parentb9dbddf6dace2094061d5093743f29c100cfd534 (diff)
downloadgit-b16b60f71b2354cbad5f2dc16bd5f6cf7d617579.zip
git-b16b60f71b2354cbad5f2dc16bd5f6cf7d617579.tar.gz
git-b16b60f71b2354cbad5f2dc16bd5f6cf7d617579.tar.bz2
Merge branch 'sb/object-store-grafts' into sb/object-store-lookup
* sb/object-store-grafts: commit: allow lookup_commit_graft to handle arbitrary repositories commit: allow prepare_commit_graft to handle arbitrary repositories shallow: migrate shallow information into the object parser path.c: migrate global git_path_* to take a repository argument cache: convert get_graft_file to handle arbitrary repositories commit: convert read_graft_file to handle arbitrary repositories commit: convert register_commit_graft to handle arbitrary repositories commit: convert commit_graft_pos() to handle arbitrary repositories shallow: add repository argument to is_repository_shallow shallow: add repository argument to check_shallow_file_for_update shallow: add repository argument to register_shallow shallow: add repository argument to set_alternate_shallow_file commit: add repository argument to lookup_commit_graft commit: add repository argument to prepare_commit_graft commit: add repository argument to read_graft_file commit: add repository argument to register_commit_graft commit: add repository argument to commit_graft_pos object: move grafts to object parser object-store: move object access functions to object-store.h
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index cc7a42f..dbd879a 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -19,6 +19,7 @@
#include "sha1-array.h"
#include "oidset.h"
#include "packfile.h"
+#include "object-store.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
@@ -396,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);
@@ -427,7 +428,7 @@ static int find_common(struct fetch_pack_args *args,
if (skip_prefix(line, "shallow ", &arg)) {
if (get_oid_hex(arg, &oid))
die(_("invalid shallow line: %s"), line);
- register_shallow(&oid);
+ register_shallow(the_repository, &oid);
continue;
}
if (skip_prefix(line, "unshallow ", &arg)) {
@@ -985,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;
@@ -1083,7 +1084,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
static void add_shallow_requests(struct strbuf *req_buf,
const struct fetch_pack_args *args)
{
- 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);
@@ -1195,7 +1196,7 @@ static int send_fetch_request(int fd_out, const struct fetch_pack_args *args,
/* Add shallow-info and deepen request */
if (server_supports_feature("fetch", "shallow", 0))
add_shallow_requests(&req_buf, args);
- else if (is_repository_shallow() || args->deepen)
+ else if (is_repository_shallow(the_repository) || args->deepen)
die(_("Server does not support shallow requests"));
/* Add filter */
@@ -1308,7 +1309,7 @@ static void receive_shallow_info(struct fetch_pack_args *args,
if (skip_prefix(reader->line, "shallow ", &arg)) {
if (get_oid_hex(arg, &oid))
die(_("invalid shallow line: %s"), reader->line);
- register_shallow(&oid);
+ register_shallow(the_repository, &oid);
continue;
}
if (skip_prefix(reader->line, "unshallow ", &arg)) {
@@ -1479,7 +1480,7 @@ static void update_shallow(struct fetch_pack_args *args,
if (args->deepen && alternate_shallow_file) {
if (*alternate_shallow_file == '\0') { /* --unshallow */
- unlink_or_warn(git_path_shallow());
+ unlink_or_warn(git_path_shallow(the_repository));
rollback_lock_file(&shallow_lock);
} else
commit_lock_file(&shallow_lock);