* Static method to get the singleton instance of the `GitClient`, * creating it, if not created yet.
()
| 235 | this.runGraceful(['am', '--abort'], {stdio: 'ignore'}); |
| 236 | // Abort any outstanding cherry-picks. |
| 237 | this.runGraceful(['cherry-pick', '--abort'], {stdio: 'ignore'}); |
| 238 | // Abort any outstanding rebases. |
| 239 | this.runGraceful(['rebase', '--abort'], {stdio: 'ignore'}); |
| 240 | // Clear any changes in the current repo. |
| 241 | this.runGraceful(['reset', '--hard'], {stdio: 'ignore'}); |
| 242 | } |
| 243 | return this.runGraceful(['checkout', branchOrRevision], {stdio: 'ignore'}).status === 0; |
| 244 | } |
| 245 | |
| 246 | /** Retrieve a list of all files in the repository changed since the provided shaOrRef. */ |
| 247 | allChangesFilesSince(shaOrRef = 'HEAD'): string[] { |
| 248 | assertValidGitRef(shaOrRef); |
| 249 | return Array.from( |
| 250 | new Set([ |
| 251 | ...gitOutputAsArray(this.runGraceful(['diff', '--name-only', '--diff-filter=d', shaOrRef])), |