diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:27:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:27:29 -0700 |
commit | 420147290dc6f96d5007da7a089ab2ac9f1e99d4 (patch) | |
tree | c6347d1fe1408421b12d69512407e4c866930fde | |
parent | 4fec83045bdc53ed9d3ff71ed099e3e6992b5c56 (diff) | |
parent | b9612197798dbfc622c766e83b1fe4c20bffae5c (diff) | |
download | git-420147290dc6f96d5007da7a089ab2ac9f1e99d4.tar.gz |
Merge branch 'jk/maint-upload-pack-shallow' into maint-1.7.4
* jk/maint-upload-pack-shallow:
upload-pack: start pack-objects before async rev-list
-rw-r--r-- | upload-pack.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/upload-pack.c b/upload-pack.c index b40a43f27d..45a60e60fc 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -156,15 +156,8 @@ static void create_pack_file(void) const char *argv[10]; int arg = 0; - if (shallow_nr) { - memset(&rev_list, 0, sizeof(rev_list)); - rev_list.proc = do_rev_list; - rev_list.out = -1; - if (start_async(&rev_list)) - die("git upload-pack: unable to fork git-rev-list"); - argv[arg++] = "pack-objects"; - } else { - argv[arg++] = "pack-objects"; + argv[arg++] = "pack-objects"; + if (!shallow_nr) { argv[arg++] = "--revs"; if (create_full_pack) argv[arg++] = "--all"; @@ -182,7 +175,7 @@ static void create_pack_file(void) argv[arg++] = NULL; memset(&pack_objects, 0, sizeof(pack_objects)); - pack_objects.in = shallow_nr ? rev_list.out : -1; + pack_objects.in = -1; pack_objects.out = -1; pack_objects.err = -1; pack_objects.git_cmd = 1; @@ -191,8 +184,14 @@ static void create_pack_file(void) if (start_command(&pack_objects)) die("git upload-pack: unable to fork git-pack-objects"); - /* pass on revisions we (don't) want */ - if (!shallow_nr) { + if (shallow_nr) { + memset(&rev_list, 0, sizeof(rev_list)); + rev_list.proc = do_rev_list; + rev_list.out = pack_objects.in; + if (start_async(&rev_list)) + die("git upload-pack: unable to fork git-rev-list"); + } + else { FILE *pipe_fd = xfdopen(pack_objects.in, "w"); if (!create_full_pack) { int i; |