Re: [PATCH v2 02/13] refs.c: use a single exit path from transaction commit and handle onerr

2014-04-22 Thread Ronnie Sahlberg
On Tue, Apr 22, 2014 at 12:11 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> diff --git a/refs.c b/refs.c >> index 138ab70..9daf89e 100644 >> --- a/refs.c >> +++ b/refs.c >> @@ -3414,12 +3414,12 @@ int ref_transaction_commit(struct ref_transaction >> *transaction, >>

Re: [PATCH v2 02/13] refs.c: use a single exit path from transaction commit and handle onerr

2014-04-22 Thread Junio C Hamano
Ronnie Sahlberg writes: > @@ -3481,6 +3481,14 @@ cleanup: > unlock_ref(updates[i]->lock); > free(delnames); > ref_transaction_free(transaction); > + if (ret) { > + const char *str = "Cannot commit transaction."; > + switch (onerr) { >

Re: [PATCH v2 02/13] refs.c: use a single exit path from transaction commit and handle onerr

2014-04-22 Thread Junio C Hamano
Ronnie Sahlberg writes: > diff --git a/refs.c b/refs.c > index 138ab70..9daf89e 100644 > --- a/refs.c > +++ b/refs.c > @@ -3414,12 +3414,12 @@ int ref_transaction_commit(struct ref_transaction > *transaction, > const char *msg, enum action_on_err onerr) > ... > + if

[PATCH v2 02/13] refs.c: use a single exit path from transaction commit and handle onerr

2014-04-21 Thread Ronnie Sahlberg
Update ref_transaction_commit to have a single exit path and process onerr if an error occured during hte commit. This does mean that in case of an error occuring for UPDATE_REFS_MSG_ON_ERR during the calls to update_ref_lock or update_ref_write we will log errors from both those functions as well