Revert "fix(steps/git): use config_writer to set force-fetch refspec"
Python package / build (3.12.3) (pull_request) Canceled after 42s
Python package / build (3.13) (pull_request) Canceled after 0s
Python package / build (3.14) (pull_request) Canceled after 0s

This reverts commit 3dd0657733.
This commit is contained in:
hermes
2026-09-18 21:54:20 +00:00
parent 3dd0657733
commit 962b34e8ee
+1 -6
View File
@@ -103,18 +103,13 @@ class GitClone(AbstractStep[str]):
remote.set_url(auth_url)
else:
remote = repo.create_remote(remote_name, auth_url)
with repo.config_writer() as config:
config.set_value(
f'remote "{remote_name}".fetch',
f'+refs/heads/*:refs/remotes/{remote_name}/*',
)
if remote_name == "origin" and self.branchNamePrefix != "":
with repo.config_writer() as config:
config.set_value('remote "origin"', "fetch",
f"+refs/heads/{self.branchNamePrefix}/*:refs/remotes/origin/{self.branchNamePrefix}/*")
result = remote.fetch(prune=True)
if not result or any(fetch_info.flags & fetch_info.ERROR for fetch_info in result):
raise BaseException(f"Failed to fetch updates for {remote_name}")
raise BaseException(f"Failed to fetch updates for {repository_url}")
if not os.path.exists(os.path.join(self.repo_path, ".git")):
raise BaseException(f"Failed to clone repositories {self.remotes} to {self.repo_path}")
except BaseException as e: