(untracked: boolean, pathspec?: string[])
| 237 | } |
| 238 | |
| 239 | async isDirty(untracked: boolean, pathspec?: string[]): Promise<boolean> { |
| 240 | const pathspecArgs = pathspec ? ['--', ...pathspec] : [] |
| 241 | // Check untracked changes |
| 242 | const sargs = ['--porcelain', '-unormal'] |
| 243 | sargs.push(...pathspecArgs) |
| 244 | if (untracked && (await this.status(sargs))) { |
| 245 | return true |
| 246 | } |
| 247 | // Check working index changes |
| 248 | if (await this.hasDiff(pathspecArgs)) { |
| 249 | return true |
| 250 | } |
| 251 | // Check staged changes |
| 252 | const dargs = ['--staged'] |
| 253 | dargs.push(...pathspecArgs) |
| 254 | if (await this.hasDiff(dargs)) { |
| 255 | return true |
| 256 | } |
| 257 | return false |
| 258 | } |
| 259 | |
| 260 | async push(options?: string[]): Promise<void> { |
| 261 | const args = ['push'] |
no test coverage detected