MCPcopy Create free account
hub / github.com/ClangBuiltLinux/tc-build / update

Method update

tc_build/source.py:143–158  ·  view source on GitHub ↗
(self, ref: str)

Source from the content-addressed store, hash-verified

141 return True
142
143 def update(self, ref: str) -> None:
144 tc_build.utils.print_header(f"Updating {self._pretty_name}")
145
146 self.git(['fetch', 'origin'])
147
148 if self.is_shallow() and not self.ref_exists(ref):
149 msg = f"Repo is shallow and supplied ref ('{ref}') does not exist!"
150 raise RuntimeError(msg)
151
152 self.git(['checkout', ref])
153
154 local_ref = None
155 with contextlib.suppress(subprocess.CalledProcessError):
156 local_ref = self.git_capture(['symbolic-ref', '-q', 'HEAD'])
157 if local_ref and local_ref.startswith('refs/heads/'):
158 self.git(['pull', '--rebase', 'origin', local_ref.replace('refs/heads/', '')])

Callers 4

build-rust.pyFile · 0.80
build-llvm.pyFile · 0.80
downloadMethod · 0.80
configureMethod · 0.80

Calls 4

gitMethod · 0.95
is_shallowMethod · 0.95
ref_existsMethod · 0.95
git_captureMethod · 0.95

Tested by

no test coverage detected