From: Junio C Hamano Date: Tue, 31 May 2016 18:12:59 GMT Subject: Re: [PATCH v3 6/6] worktree: add "unlock" command Message-ID: In-Reply-To: <20160530104939.28407-7-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > + if (is_main_worktree(wt)) > + die(_("'%s' is a main working directory"), av[0]); > + if (!wt->lock_reason) > + die(_("'%s' is not locked"), av[0]); Exactly the same comment about the lack of need for lock_reason field as 5/6 appiles here. Also, as "lock" does not allow you to lock the primary tree, do you even need is_main_worktree() check? That is: if (!worktree_is_locked(wt, &reason)) die(_("'%s' is not locked), av[0]); should be sufficient, no?