aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorCalvin Wan <calvinwan@google.com>2023-01-19 22:05:38 +0000
committerJunio C Hamano <gitster@pobox.com>2023-01-19 14:41:48 -0800
commit06a668cb90a6e8628f295adb6177855bb0a85a4a (patch)
tree1b6b60ad6d057083d2e7a759b7028c7250dbef6f /builtin/fetch.c
parentSync with maint-2.38 (diff)
downloadgit-06a668cb90a6e8628f295adb6177855bb0a85a4a.tar.gz
git-06a668cb90a6e8628f295adb6177855bb0a85a4a.zip
fetch: fix duplicate remote parallel fetch bug
Fetching in parallel from a remote group with a duplicated remote results in the following: error: cannot lock ref '<ref>': is at <oid> but expected <oid> This doesn't happen in serial since fetching from the same remote that has already been fetched from is a noop. Therefore, remove any duplicated remotes after remote groups are parsed. Signed-off-by: Calvin Wan <calvinwan@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 7378cafeec..12978622d5 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2228,6 +2228,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
argv++;
}
}
+ string_list_remove_duplicates(&list, 0);
if (negotiate_only) {
struct oidset acked_commits = OIDSET_INIT;