refs: implement simple transactions for the packed-refs file
commit9f69d297703bff37c5506276c2565c721347e03f
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 20 Jun 2013 08:37:46 +0000 (20 10:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2013 22:50:17 +0000 (20 15:50 -0700)
treee2a24bfaae82ea15b70fa15a443594483bccedae
parent2fff7812902abd0afe05ae1e9ef334fcd26f0389
refs: implement simple transactions for the packed-refs file

Handle simple transactions for the packed-refs file at the
packed_ref_cache level via new functions lock_packed_refs(),
commit_packed_refs(), and rollback_packed_refs().

Only allow the packed ref cache to be modified (via add_packed_ref())
while the packed refs file is locked.

Change clone to add the new references within a transaction.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
refs.c
refs.h