Re: push race
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Oct 15, 2012, 11:05 UTC
- Message-ID
- <vpqd30k806o.fsf@grenoble-inp.fr>
- In-Reply-To
- <CAB9Jk9Be4gGaBXixWN7Xju7N6RGKH+FonhaTbZFJ6uYsJDk8dg@mail.gmail.com>
Angelo Borsotti <angelo.borsotti@gmail.com> writes:
> the push command checks first if the tips of the branches match those > of the remote references, and if it does uploads the snapshot.
The update does two things: upload objects to the database, and then update the reference. Adding objects to the database does not change the repository until the objects are reachable from a ref. Updating the ref is usually done giving the expected old sha1, and locks the ref, so it can't change in the meantime.
I don't know this part of the code very well, but check refs.c for the C part, and "git update-ref" for the plumbing interface.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/