• Home
  • Raw
  • Download

Lines Matching +full:repo +full:- +full:name

7 #     https://www.apache.org/licenses/LICENSE-2.0
28 r"(((https:\/\/)|(git@))github.com(:|\/))?(?P<owner>[^\/]+)\/(?P<name>[^\/]+)"
34 def make_repo_clone_url(repo: str) -> str:
35 """Returns a fully-qualified repo URL on GitHub from a string containing
36 "owner/repo".
42 return f"git@github.com:{repo}.git"
44 return f"https://github.com/{repo}.git"
47 def _local_default_branch(path: pathlib.Path) -> Union[str, None]:
55 path {pathlib.Path} - Path to the local git clone
58 string -- The inferred default branch.
62 ["git", "branch", "--sort=-committerdate", "--format=%(refname:short)"],
65 .decode("utf-8")
79 ) -> pathlib.Path:
80 """Clones a remote git repo.
82 Will not actually clone the repo if it's already local via two ways:
87 url {str} -- Url pointing to remote git repo.
90 dest {pathlib.Path} -- Local folder where repo should be cloned. (default: {None})
91 committish {str} -- The commit hash to check out. (default: {None})
92 force {bool} -- Wipe out and reclone if it already exists it the cache. (default: {False})
95 pathlib.Path -- Local directory where the repo was cloned.
100 logger.debug(f"Using precloned repo {preclone}")
113 cmd = ["git", "clone", "--recurse-submodules", "--single-branch", url, dest]
122 shell.run(["git", "reset", "--hard", committish], cwd=str(dest))
127 # add repo to metadata
132 name=dest.name,
135 internal_ref=commit_metadata.get("PiperOrigin-RevId"),
142 def parse_repo_url(url: str) -> Dict[str, str]:
145 owner - Owner of the repository
146 name - Name of the repository
149 googleapis/nodejs-vision(.git)?
150 git@github.com:GoogleCloudPlatform/google-cloud-python.git
151 https://github.com/GoogleCloudPlatform/google-cloud-python.git
159 name = match.group("name")
161 if name.endswith(".git"):
162 name = name[:-4]
164 return {"owner": owner, "name": name}
167 def get_latest_commit(repo: pathlib.Path = None) -> Tuple[str, str]:
170 ["git", "log", "-1", "--pretty=%H%n%B"], cwd=repo
171 ).decode("utf-8")
176 def extract_commit_message_metadata(message: str) -> Dict[str, str]:
183 Piper-Changelog: 1234567
187 {"Piper-Changelog": "1234567"}
201 def get_preclone(url: str) -> Optional[str]:
202 """Finds a pre-cloned git repo in the preclone map."""