| 78 | |
| 79 | |
| 80 | def _pull( |
| 81 | repo, |
| 82 | git_remote: str, |
| 83 | refs: Iterable["ExpRefInfo"], |
| 84 | force: bool, |
| 85 | ) -> Mapping[SyncStatus, list["ExpRefInfo"]]: |
| 86 | refspec_list = [f"{exp_ref}:{exp_ref}" for exp_ref in refs] |
| 87 | logger.debug("git pull experiment '%s' -> '%s'", git_remote, refspec_list) |
| 88 | |
| 89 | with TqdmGit(desc="Fetching git refs") as pbar: |
| 90 | results: Mapping[str, SyncStatus] = repo.scm.fetch_refspecs( |
| 91 | git_remote, |
| 92 | refspec_list, |
| 93 | force=force, |
| 94 | progress=pbar.update_git, |
| 95 | ) |
| 96 | |
| 97 | def group_result(refspec): |
| 98 | return results[str(refspec)] |
| 99 | |
| 100 | pull_result: Mapping[SyncStatus, list[ExpRefInfo]] = group_by(group_result, refs) |
| 101 | |
| 102 | return pull_result |
| 103 | |
| 104 | |
| 105 | def _pull_cache( |