| 118 | }; |
| 119 | |
| 120 | int cmd_checkout__worker(int argc, |
| 121 | const char **argv, |
| 122 | const char *prefix, |
| 123 | struct repository *repo UNUSED) |
| 124 | { |
| 125 | struct checkout state = CHECKOUT_INIT; |
| 126 | struct option checkout_worker_options[] = { |
| 127 | OPT_STRING(0, "prefix", &state.base_dir, N_("string"), |
| 128 | N_("when creating files, prepend <string>")), |
| 129 | OPT_END() |
| 130 | }; |
| 131 | |
| 132 | show_usage_with_options_if_asked(argc, argv, |
| 133 | checkout_worker_usage, |
| 134 | checkout_worker_options); |
| 135 | |
| 136 | repo_config(the_repository, git_default_config, NULL); |
| 137 | argc = parse_options(argc, argv, prefix, checkout_worker_options, |
| 138 | checkout_worker_usage, 0); |
| 139 | if (argc > 0) |
| 140 | usage_with_options(checkout_worker_usage, checkout_worker_options); |
| 141 | |
| 142 | if (state.base_dir) |
| 143 | state.base_dir_len = strlen(state.base_dir); |
| 144 | |
| 145 | /* |
| 146 | * Setting this on a worker won't actually update the index. We just |
| 147 | * need to tell the checkout machinery to lstat() the written entries, |
| 148 | * so that we can send this data back to the main process. |
| 149 | */ |
| 150 | state.refresh_cache = 1; |
| 151 | |
| 152 | worker_loop(&state); |
| 153 | return 0; |
| 154 | } |
nothing calls this directly
no test coverage detected