Re: [PATCH 12/22] delete_ref_loose(): don't muck around in the lock_file's filename

2014-04-02 Thread Michael Haggerty
On 04/01/2014 10:21 PM, Jeff King wrote: > On Tue, Apr 01, 2014 at 05:58:20PM +0200, Michael Haggerty wrote: > >> It's bad manners. Especially since, if unlink_or_warn() failed, the >> memory wasn't restored to its original contents. >> >> So make our own copy to work with. > > Sounds good... >

Re: [PATCH 12/22] delete_ref_loose(): don't muck around in the lock_file's filename

2014-04-01 Thread Jeff King
On Wed, Apr 02, 2014 at 08:52:17AM +0200, Torsten Bögershausen wrote: > + /* > + * loose. The loose file name is the same as the > + * lockfile name, minus ".lock": > + */ > + char *loose_filename = xmemdupz(lock->lk->filename, > +

Re: [PATCH 12/22] delete_ref_loose(): don't muck around in the lock_file's filename

2014-04-01 Thread Torsten Bögershausen
[] diff --git a/refs.c b/refs.c index 28d5eca..11ad23e 100644 --- a/refs.c +++ b/refs.c @@ -2485,12 +2485,14 @@ static int repack_without_ref(const char *refname) static int delete_ref_loose(struct ref_lock *lock, int flag) { if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) { -

Re: [PATCH 12/22] delete_ref_loose(): don't muck around in the lock_file's filename

2014-04-01 Thread Jeff King
On Tue, Apr 01, 2014 at 05:58:20PM +0200, Michael Haggerty wrote: > It's bad manners. Especially since, if unlink_or_warn() failed, the > memory wasn't restored to its original contents. > > So make our own copy to work with. Sounds good... > if (!(flag & REF_ISPACKED) || flag & REF_ISSY