diff options
author | Matheus Tavares <matheus.bernardino@usp.br> | 2021-05-04 13:27:30 -0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-05 12:26:36 +0900 |
commit | 70b052b209e53eb1f81bc925ea6aac0491228af0 (patch) | |
tree | 29f59ec21037ab9da06de7f47967b4493e0bdd6c /t/t5572-pull-submodule.sh | |
parent | builtin/checkout.c: complete parallel checkout support (diff) | |
download | tgif-70b052b209e53eb1f81bc925ea6aac0491228af0.tar.xz |
checkout-index: add parallel checkout support
Allow checkout-index to use the parallel checkout framework, honoring
the checkout.workers configuration.
There are two code paths in checkout-index which call
`checkout_entry()`, and thus, can make use of parallel checkout:
`checkout_file()`, which is used to write paths explicitly given at the
command line; and `checkout_all()`, which is used to write all paths in
the index, when the `--all` option is given.
In both operation modes, checkout-index doesn't abort immediately on a
`checkout_entry()` failure. Instead, it tries to check out all remaining
paths before exiting with a non-zero exit code. To keep this behavior
when parallel checkout is being used, we must allow
`run_parallel_checkout()` to try writing the queued entries before we
exit, even if we already got an error code from a previous
`checkout_entry()` call.
However, `checkout_all()` doesn't return on errors, it calls `exit()`
with code 128. We could make it call `run_parallel_checkout()` before
exiting, but it makes the code easier to follow if we unify the exit
path for both checkout-index modes at `cmd_checkout_index()`, and let
this function take care of the interactions with the parallel checkout
API. So let's do that.
With this change, we also have to consider whether we want to keep using
128 as the error code for `git checkout-index --all`, while we use 1 for
`git checkout-index <path>` (even when the actual error is the same).
Since there is not much value in having code 128 only for `--all`, and
there is no mention about it in the docs (so it's unlikely that changing
it will break any existing script), let's make both modes exit with code
1 on `checkout_entry()` errors.
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5572-pull-submodule.sh')
0 files changed, 0 insertions, 0 deletions