use_ok 'Gitalist::Git::Object::Blob';
use_ok 'Gitalist::Git::Object::Commit';
use_ok 'Gitalist::Git::Object::Tag';
- }
+}
my $object = Gitalist::Git::Object::Tree->new(
repository => $repository,
__CLASS__ => 'Gitalist::Git::Repository',
description => 'some test repository',
is_bare => 1,
- last_change => '2009-11-12T19:00:34Z',
+ last_change => '2011-06-05T23:00:44Z',
name => 'repo1',
owner => code(\&is_system_account_name),
},
__CLASS__ => 'Gitalist::Git::Repository',
description => 'some test repository',
is_bare => 1,
- last_change => '2009-11-12T19:00:34Z',
+ last_change => '2011-06-05T23:00:44Z',
name => 'repo1',
owner => code(\&is_system_account_name),
},
__CLASS__ => 'Gitalist::Git::Repository',
description => 'some test repository',
is_bare => 1,
- last_change => '2009-11-12T19:00:34Z',
+ last_change => '2011-06-05T23:00:44Z',
name => 'repo1',
owner => code(\&is_system_account_name),
},
__CLASS__ => 'Gitalist::Git::Repository',
description => 'some test repository',
is_bare => 1,
- last_change => '2009-11-12T19:00:34Z',
+ last_change => '2011-06-05T23:00:44Z',
name => 'repo1',
owner => code(\&is_system_account_name),
},
{
my $contents = do { local $/; my $fh = $commit_obj->get_patch; <$fh> };
-ok(index($contents,
-'From 3f7567c7bdf7e7ebf410926493b92d398333116e Mon Sep 17 00:00:00 2001
-From: Florian Ragwitz <rafl@debian.org>
+like $contents, qr{^\QFrom 3f7567c7bdf7e7ebf410926493b92d398333116e Mon Sep 17 00:00:00 2001
+From: Florian Ragwitz <\Erafl[@]debian\Q.org>
Date: Tue, 6 Mar 2007 20:39:45 +0100
Subject: [PATCH] bar
---
- file1 | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ file1 |\E\s+2\Q +-
+ 1 \Efiles?\Q changed, 1 \Einsertions?\Q(+), 1 \Edeletions?\Q(-)
diff --git a/file1 b/file1
index 257cc56..5716ca5 100644
@@ -1 +1 @@
-foo
+bar
---') == 0, 'commit_obj->get_patch can return a patch')
- or warn("Got instead: $contents");
+--}, 'commit_obj->get_patch can return a patch';
}
# Note - 2 patches = 3 parts due to where we split.
'commit_obj->get_patch can return a patchset')
or warn("Contents was $contents");
}
+
+my $blame_this = Gitalist::Git::Object::Commit->new(
+ repository => $repository,
+ sha1 => 'd6ddf8b26be63066e01d96a0922c87cd8d6e2270',
+);
+
+{
+ local $SIG{ALRM} = sub { die "Regressions suck!" };
+ alarm 1;
+ eval { $blame_this->blame('empty-for-a-reason', $blame_this->sha1) };
+ is $@, '', "Silly infinite loop didn't manifest for an empty file.";
+}
+
done_testing;
sub is_system_account_name {