aboutsummaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c72
1 files changed, 2 insertions, 70 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 2d2b70cbf2..88dac1b65c 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -704,56 +704,6 @@ error:
return -1;
}
-static int get_reachable_list(struct upload_pack_data *data,
- struct object_array *reachable)
-{
- struct child_process cmd = CHILD_PROCESS_INIT;
- int i;
- struct object *o;
- char namebuf[GIT_MAX_HEXSZ + 2]; /* ^ + hash + LF */
- const unsigned hexsz = the_hash_algo->hexsz;
- int ret;
-
- if (do_reachable_revlist(&cmd, &data->shallows, reachable,
- data->allow_uor) < 0) {
- ret = -1;
- goto out;
- }
-
- while ((i = read_in_full(cmd.out, namebuf, hexsz + 1)) == hexsz + 1) {
- struct object_id oid;
- const char *p;
-
- if (parse_oid_hex(namebuf, &oid, &p) || *p != '\n')
- break;
-
- o = lookup_object(the_repository, &oid);
- if (o && o->type == OBJ_COMMIT) {
- o->flags &= ~TMP_MARK;
- }
- }
- for (i = get_max_object_index(the_repository); 0 < i; i--) {
- o = get_indexed_object(the_repository, i - 1);
- if (o && o->type == OBJ_COMMIT &&
- (o->flags & TMP_MARK)) {
- add_object_array(o, NULL, reachable);
- o->flags &= ~TMP_MARK;
- }
- }
- close(cmd.out);
-
- if (finish_command(&cmd)) {
- ret = -1;
- goto out;
- }
-
- ret = 0;
-
-out:
- child_process_clear(&cmd);
- return ret;
-}
-
static int has_unreachable(struct object_array *src, enum allow_uor allow_uor)
{
struct child_process cmd = CHILD_PROCESS_INIT;
@@ -881,29 +831,11 @@ static void deepen(struct upload_pack_data *data, int depth)
struct object *object = data->shallows.objects[i].item;
object->flags |= NOT_SHALLOW;
}
- } else if (data->deepen_relative) {
- struct object_array reachable_shallows = OBJECT_ARRAY_INIT;
- struct commit_list *result;
-
- /*
- * Checking for reachable shallows requires that our refs be
- * marked with OUR_REF.
- */
- refs_head_ref_namespaced(get_main_ref_store(the_repository),
- check_ref, data);
- for_each_namespaced_ref_1(check_ref, data);
-
- get_reachable_list(data, &reachable_shallows);
- result = get_shallow_commits(&reachable_shallows,
- depth + 1,
- SHALLOW, NOT_SHALLOW);
- send_shallow(data, result);
- free_commit_list(result);
- object_array_clear(&reachable_shallows);
} else {
struct commit_list *result;
- result = get_shallow_commits(&data->want_obj, depth,
+ result = get_shallow_commits(&data->want_obj, &data->shallows,
+ data->deepen_relative, depth,
SHALLOW, NOT_SHALLOW);
send_shallow(data, result);
free_commit_list(result);