<commit_before>"use strict";

// Git operations backed by nodegit.

let Git = require("nodegit");
let Checkout = Git.Checkout;
let common = require("./common");

exports.getGitContext = function (filePath) {
  let wd = null;

  return common.getActiveRepo(filePath)
    .then((atomRepo) => {
      if (!atomRepo) return null;

      wd = atomRepo.getWorkingDirectory();
      atomRepo.destroy();

      return Git.Repository.open(wd);
    })
    .then((nodegitRepo) => {<commit_msg>Turns out you _can't_ just require nodegit<commit_after>"use strict";

// Git operations backed by nodegit.

let a = require("atom");
let Git = a.GitRepositoryAsync.Git;
let Checkout = Git.Checkout;
let Directory = a.Directory;
let common = require("./common");

exports.getGitContext = function (filePath) {
  let wd = null;

  return common.getActiveRepo(filePath)
    .then((atomRepo) => {
      if (!atomRepo) return null;

      wd = atomRepo.getWorkingDirectory();
      atomRepo.destroy();

      return Git.Repository.open(wd);
    })
    .then((nodegitRepo) => {
{'fraction_non_alphanumeric': 0.14055080721747387, 'fraction_numerical': 0.0, 'mean_word_length': 3.543103448275862, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3552905', 'n_tokens_mistral': 341, 'n_tokens_neox': 336, 'n_words': 82}