<commit_before>import { git } from './core'
import { Repository } from '../../models/repository'

/** Get the remote names. */
export async function getRemotes(repository: Repository): Promise<ReadonlyArray<string>> {
  const result = await git([ 'remote' ], repository.path, 'getRemotes')
  const lines = result.stdout
  return lines.split('\n')
}

/** Get the name of the default remote. */
export async function getDefaultRemote(repository: Repository): Promise<string | null> {
  const remotes = await getRemotes(repository)
  if (remotes.length === 0) {
    return null
  }

  const index = remotes.indexOf('origin')
  if (index > -1) {<commit_msg>bugfix - filter empty rows from list of remotes<commit_after>import { git } from './core'
import { Repository } from '../../models/repository'

/** Get the remote names. */
export async function getRemotes(repository: Repository): Promise<ReadonlyArray<string>> {
  const result = await git([ 'remote' ], repository.path, 'getRemotes')
  const lines = result.stdout
  const rows = lines.split('\n')
  return rows.filter(r => r.trim().length > 0)
}

/** Get the name of the default remote. */
export async function getDefaultRemote(repository: Repository): Promise<string | null> {
  const remotes = await getRemotes(repository)
  if (remotes.length === 0) {
    return null
  }

  const index = remotes.indexOf('origin')
  if (index > -1) {
{'fraction_non_alphanumeric': 0.1407035175879397, 'fraction_numerical': 0.003589375448671931, 'mean_word_length': 4.106227106227106, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '86729', 'n_tokens_mistral': 405, 'n_tokens_neox': 403, 'n_words': 130}