* 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)
| 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 | } |
no test coverage detected