Junio C Hamano [off-list ref] writes:
quoted hunk ↗ jump to hunk
cmd_switch(), cmd_restore(), and cmd_checkout() pass their options
to checkout_main(), which parses options and configuration,
validates and dispatches to checkout_branch() or checkout_paths().
Now that option initialization, validation, and branch setup have been
split into dedicated helper functions, restructure cmd_switch(),
cmd_restore(), and cmd_checkout() to invoke these helpers directly and
dispatch to checkout_branch() or checkout_paths().
In cmd_restore(), handle the --staged default from_treeish = "HEAD" and
resolve opts.from_treeish into new_branch_info and opts.source_tree.
This allows us to remove checkout_main() and enum checkout_command
as they are no longer needed.
Signed-off-by: Junio C Hamano <redacted>
---
builtin/checkout.c | 297 +++++++++++++++++++++++----------------------
1 file changed, 149 insertions(+), 148 deletions(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2edaca5539..b18515ac7f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1341,12 +1341,6 @@ static void setup_new_branch_info_and_source_tree(
}
-enum checkout_command {
- CHECKOUT_CHECKOUT = 1,
- CHECKOUT_SWITCH = 2,
- CHECKOUT_RESTORE = 3,
-};
-
Okay so this is how the first commit fits in. Now it makes sense.
[snip]