From: Jonathan Nieder Date: Tue, 16 Sep 2014 22:17:45 GMT Subject: Re: [PATCH v5 17/35] commit_lock_file(): die() if called for unlocked lockfile object Message-ID: <20140916221745.GQ29050@google.com> In-Reply-To: <1410896036-12750-18-git-send-email-mhagger@alum.mit.edu> Michael Haggerty wrote: > --- a/lockfile.c > +++ b/lockfile.c > @@ -312,6 +312,9 @@ int commit_lock_file(struct lock_file *lk) > { > char result_file[PATH_MAX]; > > + if (!lk->filename[0]) > + die("BUG: attempt to commit unlocked object"); Sure, this is fine instead of an assert() too. :) Thanks, Jonathan