Re: [PATCH v1 08/11] restore: support --patch

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

 



On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
>
> git-restore is different from git-checkout that it only restores the
> worktree by default, not both worktree and index. add--interactive
> needs some update to support this mode.

Nice!  That removes my frowny face from a few patches before...  :-)

> @@ -436,9 +436,10 @@ static int checkout_paths(const struct checkout_opts *opts,
>                         patch_mode = "--patch=checkout";
>                 else if (opts->checkout_index && !opts->checkout_worktree)
>                         patch_mode = "--patch=reset";
> +               else if (!opts->checkout_index && opts->checkout_worktree)
> +                       patch_mode = "--patch=worktree";
>                 else
> -                       die(_("'%s' with only '%s' is not currently supported"),
> -                           "--patch", "--worktree");
> +                       BUG("either flag must have been set");

Very minor nit: I suspect we'll never hit this, but do we want to make
the error message slightly more descriptive ("which flags"?) in case
someone doing refactoring work does?




[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]

  Powered by Linux