};
static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
#define COMPLETE (1U << 0)
#define COMMON (1U << 1)
#define SEEN (1U << 3)
#define POPPED (1U << 4)
+static int marked;
+
/*
* After sending this many "have"s if we do not get any new ACK , we
* give up traversing our history.
return 0;
}
+static int clear_marks(const char *path, const unsigned char *sha1, int flag, void *cb_data)
+{
+ struct object *o = deref_tag(parse_object(sha1), path, 0);
+
+ if (o && o->type == OBJ_COMMIT)
+ clear_commit_marks((struct commit *)o,
+ COMMON | COMMON_REF | SEEN | POPPED);
+ return 0;
+}
+
/*
This function marks a rev and its ancestors as common.
In some cases, it is desirable to mark only the ancestors (for example
while (commit == NULL) {
unsigned int mark;
- struct commit_list *parents = NULL;
+ struct commit_list *parents;
if (rev_list == NULL || non_common_revs == 0)
return NULL;
commit = rev_list->item;
- if (!(commit->object.parsed))
- if (!parse_commit(commit))
- parents = commit->parents;
+ if (!commit->object.parsed)
+ parse_commit(commit);
+ parents = commit->parents;
commit->object.flags |= POPPED;
if (!(commit->object.flags & COMMON))
unsigned in_vain = 0;
int got_continue = 0;
+ if (marked)
+ for_each_ref(clear_marks, NULL);
+ marked = 1;
+
for_each_ref(rev_list_insert_ref, NULL);
fetching = 0;
}
if (!fetching)
- packet_write(fd[1], "want %s%s%s%s%s%s%s\n",
+ packet_write(fd[1], "want %s%s%s%s%s%s%s%s\n",
sha1_to_hex(remote),
(multi_ack ? " multi_ack" : ""),
(use_sideband == 2 ? " side-band-64k" : ""),
(use_sideband == 1 ? " side-band" : ""),
(args.use_thin_pack ? " thin-pack" : ""),
(args.no_progress ? " no-progress" : ""),
+ (args.include_tag ? " include-tag" : ""),
" ofs-delta");
else
packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
args.use_thin_pack = 1;
continue;
}
+ if (!strcmp("--include-tag", arg)) {
+ args.include_tag = 1;
+ continue;
+ }
if (!strcmp("--all", arg)) {
args.fetch_all = 1;
continue;