MCPcopy Index your code
hub / github.com/peter-evans/create-pull-request / isDirty

Method isDirty

src/git-command-manager.ts:239–258  ·  view source on GitHub ↗
(untracked: boolean, pathspec?: string[])

Source from the content-addressed store, hash-verified

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']

Callers 2

createOrUpdateBranchFunction · 0.80

Calls 3

statusMethod · 0.95
hasDiffMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected