<commit_before>import { git, GitError } from './core'
import { isHeadUnborn } from './rev-parse'
import { stageFiles } from './add'
import { Repository } from '../../models/repository'
import { WorkingDirectoryFileChange } from '../../models/status'

export async function createCommit(repository: Repository, message: string, files: ReadonlyArray<WorkingDirectoryFileChange>): Promise<boolean> {
  // Clear the staging area, our diffs reflect the difference between the
  // working directory and the last commit (if any) so our commits should
  // do the same thing.
  if (await isHeadUnborn(repository)) {
    await git([ 'reset' ], repository.path, 'createCommit')
  } else {
    await git([ 'reset', 'HEAD', '--mixed' ], repository.path, 'createCommit')
  }

  await stageFiles(repository, files)<commit_msg>Don't reset as part of createCommit anymore<commit_after>import { git, GitError } from './core'
import { stageFiles } from './add'
import { Repository } from '../../models/repository'
import { WorkingDirectoryFileChange } from '../../models/status'

export async function createCommit(repository: Repository, message: string, files: ReadonlyArray<WorkingDirectoryFileChange>): Promise<boolean> {
  await stageFiles(repository, files)
{'fraction_non_alphanumeric': 0.13162118780096307, 'fraction_numerical': 0.0, 'mean_word_length': 4.720183486238532, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5686516', 'n_tokens_mistral': 331, 'n_tokens_neox': 336, 'n_words': 112}