aboutsummaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-03-03 22:27:33 -0500
committerJunio C Hamano <gitster@pobox.com>2008-03-04 23:28:14 -0800
commit348e390b17e7a2b0618fbbfe8cdefa3d73ecbea2 (patch)
treee87eb0c168cf3f37127bbb4fa6bdc68df98ae57c /upload-pack.c
parentf0a24aa56e49a5cb03101ead0211c7080b96c9f1 (diff)
downloadgit-348e390b17e7a2b0618fbbfe8cdefa3d73ecbea2.tar.gz
git-348e390b17e7a2b0618fbbfe8cdefa3d73ecbea2.tar.xz
Teach fetch-pack/upload-pack about --include-tag
The new protocol extension "include-tag" allows the client side of the connection (fetch-pack) to request that the server side of the native git protocol (upload-pack / pack-objects) use --include-tag as it prepares the packfile, thus ensuring that an annotated tag object will be included in the resulting packfile if the object it refers to was also included into the packfile. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 660134a30..b46dd365e 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -27,7 +27,8 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
static unsigned long oldest_have;
static int multi_ack, nr_our_refs;
-static int use_thin_pack, use_ofs_delta, no_progress;
+static int use_thin_pack, use_ofs_delta, use_include_tag;
+static int no_progress;
static struct object_array have_obj;
static struct object_array want_obj;
static unsigned int timeout;
@@ -162,6 +163,8 @@ static void create_pack_file(void)
argv[arg++] = "--progress";
if (use_ofs_delta)
argv[arg++] = "--delta-base-offset";
+ if (use_include_tag)
+ argv[arg++] = "--include-tag";
argv[arg++] = NULL;
memset(&pack_objects, 0, sizeof(pack_objects));
@@ -494,6 +497,8 @@ static void receive_needs(void)
use_sideband = DEFAULT_PACKET_MAX;
if (strstr(line+45, "no-progress"))
no_progress = 1;
+ if (strstr(line+45, "include-tag"))
+ use_include_tag = 1;
/* We have sent all our refs already, and the other end
* should have chosen out of them; otherwise they are
@@ -565,7 +570,8 @@ static void receive_needs(void)
static int send_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
{
static const char *capabilities = "multi_ack thin-pack side-band"
- " side-band-64k ofs-delta shallow no-progress";
+ " side-band-64k ofs-delta shallow no-progress"
+ " include-tag";
struct object *o = parse_object(sha1);
if (!o)