From 1d3c5ab935b5d821b175f8b6c69fcef6269137c2 Mon Sep 17 00:00:00 2001 From: mck Date: Sat, 28 Sep 2024 18:51:35 +0300 Subject: [PATCH] Ignore github pull request refs when cloning or fetching follow on from 3d84863d766a95fe1e37d779d12de2358a35c923 patch by Mick Semb Wever; reviewed by Brandon Williams --- ccmlib/repository.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ccmlib/repository.py b/ccmlib/repository.py index 162c9579..3c0e50c5 100644 --- a/ccmlib/repository.py +++ b/ccmlib/repository.py @@ -164,15 +164,19 @@ def clone_development(git_repo, version, verbose=False, alias=False): if not os.path.exists(local_git_cache): common.info("Cloning Cassandra...") process = subprocess.Popen( - ['git', 'clone', '--mirror', git_repo, local_git_cache], + ['git', 'clone', '--mirror', + '-c remote.origin.fetch=+refs/heads/*:refs/heads/*', + '-c remote.origin.fetch=+refs/tags/*:refs/tags/*', + git_repo, local_git_cache], cwd=__get_dir(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, _, _ = log_info(process, logger) assert out == 0, "Could not do a git clone" else: common.info("Fetching Cassandra updates...") process = subprocess.Popen( - ['git', 'fetch', '-fup', 'origin', '+refs/*:refs/*'], - cwd=local_git_cache, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + ['git', 'fetch', '-fup', 'origin', + '+refs/heads/*:refs/heads/*', '+refs/tags/*:refs/tags/*'], + cwd=local_git_cache, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, _, _ = log_info(process, logger) assert out == 0, "Could not update git"