<commit_before>require File.expand_path("#{File.dirname(__FILE__)}/../../../test_helper")

class Piston::Git::TestGitCommitRememberance < Piston::TestCase
  def setup
    super
    @repos = mock("repository")
    @repos.stubs(:url).returns("git://github.com/francois/arepos.git")

    @reposdir = Pathname.new("tmp/repos.git")
    @commit = Piston::Git::Commit.new(@repos, "ab"*20)
    @values = @commit.remember_values
  end

  def test_remembers_original_commit_sha1
    assert_equal @values[Piston::Git::COMMIT], @commit.sha1
  end

  def test_remembers_original_branch_name
    assert_equal @values[Piston::Git::BRANCH], @commit.revision
  end
end
<commit_msg>Fix test rememberance of git repositories due to use of git-ls-remote to get last commit<commit_after>require File.expand_path("#{File.dirname(__FILE__)}/../../../test_helper")

class Piston::Git::TestGitCommitRememberance < Piston::TestCase
  def setup
    super
    @repos = mock("repository")
    @repos.stubs(:url).returns("git://github.com/francois/arepos.git")

    @reposdir = Pathname.new("tmp/repos.git")
    @commit = Piston::Git::Commit.new(@repos, "ab"*20)
    @commit.stubs(:git).with("ls-remote", @repos.url, @commit.commit).returns("b"*40)
    @values = @commit.remember_values
  end

  def test_remembers_original_commit_sha1
    assert_equal @values[Piston::Git::COMMIT], @commit.sha1
  end

  def test_remembers_original_branch_name
    assert_equal @values[Piston::Git::BRANCH], @commit.revision
  end
end

{'fraction_non_alphanumeric': 0.1524513096037609, 'fraction_numerical': 0.006715916722632639, 'mean_word_length': 4.866141732283465, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2261001', 'n_tokens_mistral': 549, 'n_tokens_neox': 506, 'n_words': 81}