From: Junio C Hamano Date: Fri, 21 Mar 2014 19:49:08 +0000 (-0700) Subject: Merge branch 'nd/upload-pack-shallow' X-Git-Tag: v2.0.0-rc0~76 X-Git-Url: https://repo.or.cz/w/git.git/commitdiff_plain/1ddb4d7e5ed478ec7a0335090482c1944a64aca5 Merge branch 'nd/upload-pack-shallow' Serving objects from a shallow repository needs to write a temporary file to be used, but the serving upload-pack may not have write access to the repository which is meant to be read-only. Instead feed these temporary shallow bounds from the standard input of pack-objects so that we do not have to use a temporary file. * nd/upload-pack-shallow: upload-pack: send shallow info over stdin to pack-objects --- 1ddb4d7e5ed478ec7a0335090482c1944a64aca5 diff --cc builtin/pack-objects.c index 61a55b3c7e,c2c093a33e..0ee5f1ff94 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@@ -2458,9 -2370,15 +2461,16 @@@ static void get_object_list(int ac, con if (*line == '-') { if (!strcmp(line, "--not")) { flags ^= UNINTERESTING; + write_bitmap_index = 0; continue; } + if (starts_with(line, "--shallow ")) { + unsigned char sha1[20]; + if (get_sha1_hex(line + 10, sha1)) + die("not an SHA-1 '%s'", line + 10); + register_shallow(sha1); + continue; + } die("not a rev '%s'", line); } if (handle_revision_arg(line, &revs, flags, REVARG_CANNOT_BE_FILENAME))