diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-09 01:27:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-09 09:27:46 -0700 |
commit | d79796bcf05b89774671a75b3285000c43129823 (patch) | |
tree | 55b74ef2a92d3220d61ee0b95ea632518c756746 /cache.h | |
parent | 40c155ff14c8b313d408f2e51a55c881ce082e4e (diff) | |
download | git-d79796bcf05b89774671a75b3285000c43129823.tar.gz |
push: receiver end advertises refs from alternate repositories
Earlier, when pushing into a repository that borrows from alternate object
stores, we followed the longstanding design decision not to trust refs in
the alternate repository that houses the object store we are borrowing
from. If your public repository is borrowing from Linus's public
repository, you pushed into it long time ago, and now when you try to push
your updated history that is in sync with more recent history from Linus,
you will end up sending not just your own development, but also the
changes you acquired through Linus's tree, even though the objects needed
for the latter already exists at the receiving end. This is because the
receiving end does not advertise that the objects only reachable from the
borrowed repository (i.e. Linus's) are already available there.
This solves the issue by making the receiving end advertise refs from
borrowed repositories. They are not sent with their true names but with a
phoney name ".have" to make sure that the old senders will safely ignore
them (otherwise, the old senders will misbehave, trying to push matching
refs, and mirror push that deletes refs that only exist at the receiving
end).
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -641,6 +641,8 @@ extern struct alternate_object_database { } *alt_odb_list; extern void prepare_alt_odb(void); extern void add_to_alternates_file(const char *reference); +typedef int alt_odb_fn(struct alternate_object_database *, void *); +extern void foreach_alt_odb(alt_odb_fn, void*); struct pack_window { struct pack_window *next; |