]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'gc/fetch-negotiate-only-early-return'
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Feb 2022 22:20:59 +0000 (14:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Feb 2022 22:20:59 +0000 (14:20 -0800)
"git fetch --negotiate-only" is an internal command used by "git
push" to figure out which part of our history is missing from the
other side.  It should never recurse into submodules even when
fetch.recursesubmodules configuration variable is set, nor it
should trigger "gc".  The code has been tightened up to ensure it
only does common ancestry discovery and nothing else.

* gc/fetch-negotiate-only-early-return:
  fetch: help translators by reusing the same message template
  fetch --negotiate-only: do not update submodules
  fetch: skip tasks related to fetching objects
  fetch: use goto cleanup in cmd_fetch()

1  2 
builtin/fetch.c
t/t5516-fetch-push.sh
t/t5702-protocol-v2.sh

diff --cc builtin/fetch.c
index 5f06b21f8e97c5459fdb558302c5b9b95e99eee8,5c329f98358759a0b9a552d528f1f437d6c0087f..5b3b18a72f59b5242aa9fd6ce74386c04389ecb7
@@@ -2099,8 -2098,9 +2122,9 @@@ int cmd_fetch(int argc, const char **ar
                if (gtransport->smart_options) {
                        gtransport->smart_options->acked_commits = &acked_commits;
                } else {
 -                      warning(_("Protocol does not support --negotiate-only, exiting."));
 +                      warning(_("protocol does not support --negotiate-only, exiting"));
-                       return 1;
+                       result = 1;
+                       goto cleanup;
                }
                if (server_options.nr)
                        gtransport->server_options = &server_options;
Simple merge
Simple merge