From: Elijah Newren Date: Sat, 09 Mar 2019 19:02:56 GMT Subject: Re: [PATCH v1 08/11] restore: support --patch Message-ID: In-Reply-To: <20190308101655.9767-9-pclouds@gmail.com> On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy 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?