[PATCH 0/3] Refactor checkout option handling
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Aug 28, 2012, 13:49 UTC
- Message-ID
- <1346161748-25651-1-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <7vr4qroel6.fsf@alter.siamese.dyndns.org>
On Tue, Aug 28, 2012 at 10:55 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> The surrounding code is somewhat tricky and the code structure is > brittle; there are places that update the opts.new_branch so the new > location of this check has to be after them, and there is one > codepath that having a bad value in it does not matter. > > I had to check the code outside the context of this patch a few > times to convince myself that this patch does not break them. I'll > queue the patch as-is for now, but we probably would want to see how > we can structure it to be less brittle.
I'll give it a shot. On top of master, not the "checkout -b -t" patch. The test suite passes, but we'll need more eyeballs for code moves like this.
Nguyễn Thái Ngọc Duy (3): checkout: pass "struct checkout_opts *" as const pointer checkout: reorder option handling checkout: move branch guessing code out as a separate function
builtin/checkout.c | 290 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 164 insertions(+), 126 deletions(-)
-- 1.7.12.rc2.18.g61b472e