aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/fetch-options.txt
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-01-18 16:00:56 -0800
committerJunio C Hamano <gitster@pobox.com>2022-01-18 16:22:58 -0800
commit386c076a863cfafd733b71564245be973e3d1bda (patch)
treeeedadc4a35b264d86507a62a0b02179beb369fa9 /Documentation/fetch-options.txt
parent135a12bc1472290ca6b9a4c2f06c838a1495a612 (diff)
downloadgit-386c076a863cfafd733b71564245be973e3d1bda.tar.gz
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/fetch-options.txt')
-rw-r--r--Documentation/fetch-options.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index e967ff1874..f903683189 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].