Re: [PATCH v3 6/6] worktree: add "unlock" command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 31, 2016, 18:12 UTC
- Message-ID
- <xmqqzir63xlg.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160530104939.28407-7-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> 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?