Re: [PATCH v2 5/5] worktree: add "unlock" command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 22, 2016 at 6:43 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> @@ -500,6 +501,37 @@ static int lock_worktree(int ac, const char **av, const char *prefix)
> +static int unlock_worktree(int ac, const char **av, const char *prefix)
> +{
> +       [...]
> +       wt = find_worktree_by_path(worktrees, dst.buf);
> +       strbuf_release(&dst);
> +       if (!wt)
> +               die(_("'%s' is not a working directory"), av[0]);
> +       if (is_main_worktree(wt))
> +               die(_("'%s' is a main working directory"), av[0]);
> +       if (!is_worktree_locked(wt))
> +               die(_("not locked"));

Could be _("'%s' is not locked"), but not worth a re-roll.

> +       ret = unlink_or_warn(git_common_path("worktrees/%s/locked", wt->id));
> +       free_worktrees(worktrees);
> +       return ret;
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]