<commit_before># -*- cperl -*-

use Git;
my $repo = Git->repository ( Directory => . );

my $diff = $repo->command('diff','HEAD','HEAD^1','proyectos/hito-0.md');<commit_msg>Primer test medio que va<commit_after># -*- cperl -*-

use Test::More;
use Git;

use v5.14; # For say

my $repo = Git->repository ( Directory => '.' );

my $diff = $repo->command('diff','HEAD','HEAD^1');

if ( $diff =~ /proyectos\/hito-0.md/ ) { # No veo cómo hacerlo arriba
  my @files = split(/diff --git/,$diff);
  my ($diff_hito_0) = grep( /a\/proyectos\/hito-0.md/, @files);
  my ($url_repo) = ($diff_hito_0 =~ /\n-.+(http\S+)/);
  isnt($url_repo,"","El cambio tiene un URL");
  like($url_repo,qr/github.com/,"El URL es de GitHub");
  my ($name) = ($url_repo=~ /github.com\/\S+\/(\w+)/);
  my $repo_dir = "/tmp/$name";
  mkdir($repo_dir);
  `git clone $url_repo $repo_dir`;
  my $student_repo =  Git->repository ( Directory => $repo_dir );
  my @repo_files = $student_repo->command("ls-files");
  for my $f (qw( README.md .gitignore LICENSE )) {
    isnt( grep( $f, @repo_files), 0, "$f presente" );
  }
}
done_testing();
{'fraction_non_alphanumeric': 0.2356687898089172, 'fraction_numerical': 0.010009099181073703, 'mean_word_length': 3.700854700854701, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2175910', 'n_tokens_mistral': 449, 'n_tokens_neox': 439, 'n_words': 97}