Subject: Re: [PATCH v5 17/35] commit_lock_file(): die() if called for unlocked lockfile object

From: Jonathan Nieder <[email-masked]>
Date: Tue, 16 Sep 2014 15:17:45 -0700

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