How to use the dugite.GitError.UnresolvedConflicts function in dugite

To help you get started, we’ve selected a few dugite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github desktop / desktop / app / src / lib / git / rebase.ts View on Github external
return RebaseResult.Aborted
  }

  const rebaseCurrentCommit = await readRebaseHead(repository)
  if (rebaseCurrentCommit === null) {
    return RebaseResult.Aborted
  }

  const trackedFilesAfter = status.workingDirectory.files.filter(
    f => f.status.kind !== AppFileStatusKind.Untracked
  )

  const baseOptions: IGitExecutionOptions = {
    expectedErrors: new Set([
      GitError.RebaseConflicts,
      GitError.UnresolvedConflicts,
    ]),
  }

  let options = baseOptions

  if (progressCallback !== undefined) {
    const snapshot = await getRebaseSnapshot(repository)

    if (snapshot === null) {
      log.warn(
        `[continueRebase] unable to get rebase status, skipping any other steps`
      )
      return RebaseResult.Aborted
    }

    const { progress } = snapshot
github desktop / desktop / app / src / lib / git / rebase.ts View on Github external
function parseRebaseResult(result: IGitResult): RebaseResult {
  if (result.exitCode === 0) {
    return RebaseResult.CompletedWithoutError
  }

  if (result.gitError === GitError.RebaseConflicts) {
    return RebaseResult.ConflictsEncountered
  }

  if (result.gitError === GitError.UnresolvedConflicts) {
    return RebaseResult.OutstandingFilesNotStaged
  }

  throw new Error(`Unhandled result found: '${JSON.stringify(result)}'`)
}