Re: [PATCH 1/2] restore: require --source when combining --worktree and --staged
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 1, 2020, 08:49 UTC
- Message-ID
- <CAPig+cR4VpyAzqok8+QoUgQQc=mS-ooD8+PUCPMuO6XQ21dL6w@mail.gmail.com>
- In-Reply-To
- <20200501082746.23943-2-sunshine@sunshineco.com>
On Fri, May 1, 2020 at 4:28 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 7 quoted lines
> 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.)