MCPcopy Create free account
hub / github.com/angular/dev-infra / checkout

Method checkout

ng-dev/utils/git/git-client.ts:184–197  ·  view source on GitHub ↗

* Checks out a requested branch or revision, optionally cleaning the state of the repository * before attempting the checking. Returns a boolean indicating whether the branch or revision * was cleanly checked out.

(branchOrRevision: string, cleanState: boolean)

Source from the content-addressed store, hash-verified

182 return result;
183 }
184
185 /** Git URL that resolves to the configured repository. */
186 getRepoGitUrl() {
187 return getRepositoryGitUrl(this.remoteConfig);
188 }
189
190 /** Whether the given branch contains the specified SHA. */
191 hasCommit(branchName: string, sha: string): boolean {
192 assertValidGitRef(branchName);
193 assertValidGitRef(sha);
194 return this.run(['branch', branchName, '--contains', sha]).stdout !== '';
195 }
196
197 /** Whether the local repository is configured as shallow. */
198 isShallowRepo(): boolean {
199 return this.run(['rev-parse', '--is-shallow-repository']).stdout.trim() === 'true';
200 }

Callers 5

git-client.spec.tsFile · 0.80
cleanupMethod · 0.80
rebasePrFunction · 0.80

Calls 2

runGracefulMethod · 0.95
assertValidGitRefFunction · 0.85

Tested by

no test coverage detected