summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-09-07 15:23:50 -0700
committerJunio C Hamano <gitster@pobox.com>2009-09-07 15:23:50 -0700
commit8e4384fd4438a143af7125eb0f03312a318319fb (patch)
tree291180389c88c849627dc1f0181c9b8cc87b5a02 /upload-pack.c
parent6ea71fe7d36cf5b81c2100d97a822ecf0bc04746 (diff)
parent0ef95f72f878184fbce8d7c855ab4346c081abed (diff)
downloadgit-8e4384fd4438a143af7125eb0f03312a318319fb.tar.gz
Merge branch 'np/maint-1.6.3-deepen'
* np/maint-1.6.3-deepen: pack-objects: free preferred base memory after usage make shallow repository deepening more network efficient
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/upload-pack.c b/upload-pack.c
index dacbc7614b..25e222ffaa 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -32,6 +32,7 @@ static int no_progress, daemon_mode;
static int shallow_nr;
static struct object_array have_obj;
static struct object_array want_obj;
+static struct object_array extra_edge_obj;
static unsigned int timeout;
/* 0 for no sideband,
* otherwise maximum packet size (up to 65520 bytes).
@@ -135,6 +136,10 @@ static int do_rev_list(int fd, void *create_full_pack)
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
mark_edges_uninteresting(revs.commits, &revs, show_edge);
+ if (use_thin_pack)
+ for (i = 0; i < extra_edge_obj.nr; i++)
+ fprintf(pack_pipe, "-%s\n", sha1_to_hex(
+ extra_edge_obj.objects[i].item->sha1));
traverse_commit_list(&revs, show_commit, show_object, NULL);
fflush(pack_pipe);
fclose(pack_pipe);
@@ -492,7 +497,6 @@ static void receive_needs(void)
if (!prefixcmp(line, "shallow ")) {
unsigned char sha1[20];
struct object *object;
- use_thin_pack = 0;
if (get_sha1(line + 8, sha1))
die("invalid shallow line: %s", line);
object = parse_object(sha1);
@@ -504,7 +508,6 @@ static void receive_needs(void)
}
if (!prefixcmp(line, "deepen ")) {
char *end;
- use_thin_pack = 0;
depth = strtol(line + 7, &end, 0);
if (end == line + 7 || depth <= 0)
die("Invalid deepen: %s", line);
@@ -587,6 +590,7 @@ static void receive_needs(void)
NULL, &want_obj);
parents = parents->next;
}
+ add_object_array(object, NULL, &extra_edge_obj);
}
/* make sure commit traversal conforms to client */
register_shallow(object->sha1);