On Fri, May 1, 2020 at 4:28 AM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> 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.)