In RPC mode (https), we need to resend the data so that the remote
endpoint keeps context. In non-RPC mode, we need not (and should not)
resend it. Clear that buffer data in non-RPC mode to prevent this.
When `-DUSE_HTTP_PARSER=...` is specified, ensure that the specified
HTTP Parser is valid, do not fallback to builtin.
Restore `-DUSE_HTTP_PARSER=system` for backcompatibility.
Teach the benchmark script how to clone the git or kernel repositories,
which is useful to have a larger corpus of test data. If a benchmark
script wants to `clone git` or `clone linux`, then this will be done.
Callers probably want to specify `BENCHMARK_GIT_REPOSITORY` to a
previously cloned local repository so that the script does not download
the repository repeatedly.
Move the common option information to a global place, and reuse them.
Common options will be global variables.
Specify them as _hidden_ for all commands (the main command will pass
the SHOW_HIDDEN flag to the usage printer, so that they're visible).
When the `help` command is invoked (because no command was specified) we
may need to clean up the arguments, in particular, to avoid passing
`--help` (so that the help command isn't confused, and assumes that it's
being invoked as `help --help`).
Callers may wish to show all the options, even hidden ones, when showing
usage. In particular, showing generic help for the CLI should show
global options (those that are generally "hidden"). But showing help for
a particular command should keep them hidden. Instrument a mechanism to
deal with this.
Instead of dealing with the clone options sub-options (fetch, checkout,
etc) individually, treat them as a cohesive whole when passing them
throughout the system.
Additionally, move some functions around within the file to avoid
unnecessary decls at the top of the file. And change a function
signature to avoid conflating truth with error.
Make `GIT_CHECKOUT_SAFE` the default. `NONE` is never what the user
wants _by default_; people expect checkout to, well, check things out.
Instead, it should be an opt-in "dry run" mode.
This removes some odd code in internal callers of `checkout` that takes
a `git_checkout_options` and updates the mode to `SAFE`. This is now
unnecessary since everything has better defaults.