From: Johannes Sixt Date: Sat, 02 May 2015 21:43:33 GMT Subject: Re: [PATCH 2/2] lock_packed_refs(): allow retries when acquiring the packed-refs lock Message-ID: <55454505.9060305@kdbg.org> In-Reply-To: <554448B6.6080605@alum.mit.edu> Am 02.05.2015 um 05:47 schrieb Michael Haggerty: > On 05/01/2015 06:13 PM, Johannes Sixt wrote: >> How about this: >> >> test_when_finished "wait; rm -f $LOCK" && >> { sleep 1 & } && >> ... > > Thanks for pointing out this problem. Your suggestion seems good. I > assume that you didn't intend to omit the "rm -f $LOCK" from the > subprocess, because the whole point is for that to happen while "git > pack-refs" is running. I see. So, if git pack-refs works correctly, it waits for the sub-process, and the 'wait' in test_when_finished does not buy a lot. If there is breakage, the trash directory is not attempted to be removed, and it does not matter that a process potentially occupies it. I think your version is good then. -- Hannes