walker.c: lock all refs before processing in walker_fetch

Update walker_fetch to lock all refs before we start processing them
by temporarily updating the refs to a magic sha1. Then rely on that
the first _update will lock the ref and the second time we _update the ref
we set it to the value it should have.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
receive-pack.c: add protocol support to negotiate atomic-push

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
send-pack.c: add an --atomic-push command line argument

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
receive-pack.c: use a single transaction when atomic-push is negotiated

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
refs.c: use the transaction to manage the reflog in rename_refs

We have a transaction in rename_ref to managing the ref during the rename.
Use this transaction to manage the changes to the reflog too.
This now means that rename_ref is almost completely agnostic about how refs
storage is implemented and should be easier to migrate if/when we allow a
different store for refs, such as a database.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>