mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
upload-pack: pass upload_pack_data to check_non_tip()
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to check_non_tip(), so that this function and the functions it calls, can use all the fields of the struct in followup commits. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
762f92767c
commit
b08c97423f
@@ -654,8 +654,7 @@ error:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_non_tip(struct object_array *want_obj,
|
static void check_non_tip(struct upload_pack_data *data)
|
||||||
struct packet_writer *writer)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -666,16 +665,16 @@ static void check_non_tip(struct object_array *want_obj,
|
|||||||
*/
|
*/
|
||||||
if (!stateless_rpc && !(allow_unadvertised_object_request & ALLOW_REACHABLE_SHA1))
|
if (!stateless_rpc && !(allow_unadvertised_object_request & ALLOW_REACHABLE_SHA1))
|
||||||
goto error;
|
goto error;
|
||||||
if (!has_unreachable(want_obj))
|
if (!has_unreachable(&data->want_obj))
|
||||||
/* All the non-tip ones are ancestors of what we advertised */
|
/* All the non-tip ones are ancestors of what we advertised */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
/* Pick one of them (we know there at least is one) */
|
/* Pick one of them (we know there at least is one) */
|
||||||
for (i = 0; i < want_obj->nr; i++) {
|
for (i = 0; i < data->want_obj.nr; i++) {
|
||||||
struct object *o = want_obj->objects[i].item;
|
struct object *o = data->want_obj.objects[i].item;
|
||||||
if (!is_our_ref(o)) {
|
if (!is_our_ref(o)) {
|
||||||
packet_writer_error(writer,
|
packet_writer_error(&data->writer,
|
||||||
"upload-pack: not our ref %s",
|
"upload-pack: not our ref %s",
|
||||||
oid_to_hex(&o->oid));
|
oid_to_hex(&o->oid));
|
||||||
die("git upload-pack: not our ref %s",
|
die("git upload-pack: not our ref %s",
|
||||||
@@ -1003,7 +1002,7 @@ static void receive_needs(struct upload_pack_data *data,
|
|||||||
* by another process that handled the initial request.
|
* by another process that handled the initial request.
|
||||||
*/
|
*/
|
||||||
if (has_non_tip)
|
if (has_non_tip)
|
||||||
check_non_tip(&data->want_obj, &data->writer);
|
check_non_tip(data);
|
||||||
|
|
||||||
if (!use_sideband && daemon_mode)
|
if (!use_sideband && daemon_mode)
|
||||||
no_progress = 1;
|
no_progress = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user