This patch adds support to the transaction system to update all non-refs as
packed refs instead of loose refs.

This series can also be found at

This series adds support to have transaction write updates to packed refs
instead of as loose refs.
If the transaction only contains a single update to a single ref, such as the
commit case, we continue to update this as locking and writing to the loose
ref file.
But If on the other hand the transaction will update more than one ref, then
we perform all these updates inside the packed refs file and remove all the
affected loose refs files. This allows us to both perform deletes (added
previously) as well as updates-of-more-than-one-ref as one single atomic rename

Since the transactions will now by default write directly to the packed refs
file for updates to more than one ref, we no longer need to provide a
pacekd refs api to builtin/clone.c any more. So lets change clone.c to
use a transaction. This removes 4 fucntions from the refs.c API we can now
unexport and make static.

This change means that clone will now apear as one single atomic operation
to any external observer where all refs appear at once instead of one
ref becoming visible at a time.

Ronnie Sahlberg (2):
  refs.c: write updates to packed refs when a transaction has more than
    one ref
  refs.c: make the *_packed_refs functions static

 builtin/clone.c | 16 ++++++++---
 refs.c          | 82 ++++++++++++++++++++++++++++++++++++++++-----------------
 refs.h          | 28 --------------------
 3 files changed, 70 insertions(+), 56 deletions(-)


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to