Add `--recurse-submodules` flag to supporting commands

When a repository contains git submodules, the simple `git checkout`
command will leave the working tree with uncommited changes to the
submodule references (aka dirty). This then requires a second git command
to synchronize submodules.

The checkout command already has the `--recurse-submodules` argument
that will fetch submodules of checkout, ensuring that repository is in
consistent state.

Also using this flag with repositories that doesn't have submodules, the
checkout will succeed without any complaint.

The downside is that checkout command could issue multiple parallel
fetch calls that may generate high load on the server. This is why to
enable this feature, a modification to the plugin config is required.

This change adds a new plugin configuraiton option:
`download.recurseSubmodules`, by default set to `false`. That will add
`--recurse-submodules` flag to the "checkout", "branch", "reset" and
"pull" download commands.

Bug: Issue 302090044
Change-Id: I7b003dbd0687f173e8166a5ede931f773db5439c
10 files changed
tree: 60202f5abe5aad39d0c23af760d5edc8aa6f9161
  1. src/
  2. .gitignore
  3. BUILD
  4. LICENSE
  5. README.md
README.md

Gerrit download-commands plugin

All documentation may be found under src/main/resources/Documentation/.