Re: [PATCH v5 17/35] commit_lock_file(): die() if called for unlocked lockfile object
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 16, 2014, 22:17 UTC
- Message-ID
- <20140916221745.GQ29050@google.com>
- In-Reply-To
- <1410896036-12750-18-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty wrote:
Show 8 quoted lines
> --- 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