From: Eric Sunshine Date: Fri, 01 May 2020 08:49:50 GMT Subject: Re: [PATCH 1/2] restore: require --source when combining --worktree and --staged Message-ID: In-Reply-To: <20200501082746.23943-2-sunshine@sunshineco.com> On Fri, May 1, 2020 at 4:28 AM Eric Sunshine wrote: > diff --git a/builtin/checkout.c b/builtin/checkout.c > @@ -1604,6 +1604,9 @@ static int checkout_main(int argc, const char **argv, const char *prefix, > } > if (opts->checkout_index < 0 || opts->checkout_worktree < 0) > BUG("these flags should be non-negative by now"); > + if (opts->checkout_index > 0 && opts->checkout_worktree > 0 && > + !opts->from_treeish) If I re-roll the series for some reason, I'll drop the unnecessary "> 0". (But this code goes away in patch 2/2 anyhow, so I'm not too worried about it.)