Re: [PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Jan 23, 2015 at 4:39 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> On Fri, Jan 23, 2015 at 3:57 PM, Junio C Hamano wrote: Stefan Beller writes: > -static int commit_ref(struct ref_lock *lock) > +static int commit_ref(struct ref_loc

Re: [PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Stefan Beller
On Fri, Jan 23, 2015 at 4:39 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Fri, Jan 23, 2015 at 3:57 PM, Junio C Hamano wrote: >>> Stefan Beller writes: >>> -static int commit_ref(struct ref_lock *lock) +static int commit_ref(struct ref_lock *lock, const unsigned char *sha

Re: [PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Jan 23, 2015 at 3:57 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> -static int commit_ref(struct ref_lock *lock) >>> +static int commit_ref(struct ref_lock *lock, const unsigned char *sha1) >>> { >>> + if (!lock->force_write && !hashcmp(lock->old

Re: [PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Stefan Beller
On Fri, Jan 23, 2015 at 3:57 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> -static int commit_ref(struct ref_lock *lock) >> +static int commit_ref(struct ref_lock *lock, const unsigned char *sha1) >> { >> + if (!lock->force_write && !hashcmp(lock->old_sha1, sha1)) >> + r

Re: [PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Junio C Hamano
Stefan Beller writes: > -static int commit_ref(struct ref_lock *lock) > +static int commit_ref(struct ref_lock *lock, const unsigned char *sha1) > { > + if (!lock->force_write && !hashcmp(lock->old_sha1, sha1)) > + return 0; > if (commit_lock_file(lock->lk)) >

[PATCHv3 5/6] refs.c: remove unlock_ref and commit_ref from write_ref_sha1

2015-01-23 Thread Stefan Beller
This makes write_ref_sha1 only write the the lock file, committing needs to be done outside of that function. This will help us change the ref_transaction_commit in a later patch. Also instead of calling unlock_ref before each return in write_ref_sha1 we can call this after the call. This is a fir