Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/upload-pack.c b/upload-pack.c
index dcd429dc01..8abb7de5d7 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -323,6 +323,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,
pack_objects.in = -1;
pack_objects.out = -1;
pack_objects.err = -1;
+ pack_objects.clean_on_exit = 1;
if (start_command(&pack_objects))
die("git upload-pack: unable to fork git-pack-objects");
@@ -1365,7 +1366,18 @@ void upload_pack(struct upload_pack_options *options)
PACKET_READ_DIE_ON_ERR_PACKET);
receive_needs(&data, &reader);
- if (data.want_obj.nr) {
+
+ /*
+ * An EOF at this exact point in negotiation should be
+ * acceptable from stateless clients as they will consume the
+ * shallow list before doing subsequent rpc with haves/etc.
+ */
+ if (data.stateless_rpc)
+ reader.options |= PACKET_READ_GENTLE_ON_EOF;
+
+ if (data.want_obj.nr &&
+ packet_reader_peek(&reader) != PACKET_READ_EOF) {
+ reader.options &= ~PACKET_READ_GENTLE_ON_EOF;
get_common_commits(&data, &reader);
create_pack_file(&data, NULL);
}