diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-09 01:27:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-09 09:27:46 -0700 |
commit | 40c155ff14c8b313d408f2e51a55c881ce082e4e (patch) | |
tree | 97509e2459ec5eac8e771d5ea2b131fc8faacc8d /cache.h | |
parent | be5908aed35d1c129f1ea38913b230ee1927361b (diff) | |
download | git-40c155ff14c8b313d408f2e51a55c881ce082e4e.tar.gz git-40c155ff14c8b313d408f2e51a55c881ce082e4e.tar.xz |
push: prepare sender to receive extended ref information from the receiver
"git push" enhancement allows the receiving end to report not only its own
refs but refs in repositories it borrows from via the alternate object
store mechanism. By telling the sender that objects reachable from these
extra refs are already complete in the receiving end, the number of
objects that need to be transfered can be cut down.
These entries are sent over the wire with string ".have", instead of the
actual names of the refs. This string was chosen so that they are ignored
by older programs at the sending end. If we sent some random but valid
looking refnames for these entries, "matching refs" rule (triggered when
running "git push" without explicit refspecs, where the sender learns what
refs the receiver has, and updates only the ones with the names of the
refs the sender also has) and "delete missing" rule (triggered when "git
push --mirror" is used, where the sender tells the receiver to delete the
refs it itself does not have) would try to update/delete them, which is
not what we want.
This prepares the send-pack (and "push" that runs native protocol) to
accept extended existing ref information and make use of it. The ".have"
entries are excluded from ref matching rules, and are exempt from deletion
rule while pushing with --mirror option, but are still used for pack
generation purposes by providing more "bottom" range commits.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -709,7 +709,11 @@ extern struct child_process *git_connect(int fd[2], const char *url, const char extern int finish_connect(struct child_process *conn); extern int path_match(const char *path, int nr, char **match); extern int get_ack(int fd, unsigned char *result_sha1); -extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match, unsigned int flags); +struct extra_have_objects { + int nr, alloc; + unsigned char (*array)[20]; +}; +extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match, unsigned int flags, struct extra_have_objects *); extern int server_supports(const char *feature); extern struct packed_git *parse_pack_index(unsigned char *sha1); |