diff options
author | Glen Choo <chooglen@google.com> | 2022-01-19 00:00:56 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-19 00:22:58 (GMT) |
commit | 386c076a863cfafd733b71564245be973e3d1bda (patch) | |
tree | eedadc4a35b264d86507a62a0b02179beb369fa9 /Documentation | |
parent | 135a12bc1472290ca6b9a4c2f06c838a1495a612 (diff) | |
download | git-386c076a863cfafd733b71564245be973e3d1bda.zip git-386c076a863cfafd733b71564245be973e3d1bda.tar.gz git-386c076a863cfafd733b71564245be973e3d1bda.tar.bz2 |
fetch --negotiate-only: do not update submodules
`git fetch --negotiate-only` is an implementation detail of push
negotiation and, unlike most `git fetch` invocations, does not actually
update the main repository. Thus it should not update submodules even
if submodule recursion is enabled.
This is not just slow, it is wrong e.g. push negotiation with
"submodule.recurse=true" will cause submodules to be updated because it
invokes `git fetch --negotiate-only`.
Fix this by disabling submodule recursion if --negotiate-only was given.
Since this makes --negotiate-only and --recurse-submodules incompatible,
check for this invalid combination and die.
This does not use the "goto cleanup" introduced in the previous commit
because we want to recurse through submodules whenever a ref is fetched,
and this can happen without introducing new objects.
Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/fetch-options.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index e967ff1..f903683 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -71,6 +71,7 @@ configuration variables documented in linkgit:git-config[1], and the ancestors of the provided `--negotiation-tip=*` arguments, which we have in common with the server. + +This is incompatible with `--recurse-submodules=[yes|on-demand]`. Internally this is used to implement the `push.negotiate` option, see linkgit:git-config[1]. |