From c9890ef809425a3607c2f1108eb19c30aa0f077b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 17 Feb 2019 05:09:50 +0000 Subject: git: add "commit_title" method This will be useful for extracting titles/subjects from commit objects when displaying commits. --- t/solver_git.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 't/solver_git.t') diff --git a/t/solver_git.t b/t/solver_git.t index 8de63988..6f0ce777 100644 --- a/t/solver_git.t +++ b/t/solver_git.t @@ -40,7 +40,14 @@ sub deliver_patch ($) { deliver_patch('t/solve/0001-simple-mod.patch'); -$ibx->{-repo_objs} = [ PublicInbox::Git->new($git_dir) ]; +my $git = PublicInbox::Git->new($git_dir); +is('public-inbox 1.0.0', + $git->commit_title('cb7c42b1e15577ed2215356a2bf925aef59cdd8d'), + 'commit_title works on 1.0.0'); + +is(undef, $git->commit_title('impossible'), 'undef on impossible object'); + +$ibx->{-repo_objs} = [ $git ]; my $res; my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] }); open my $log, '+>>', "$mainrepo/solve.log" or die "open: $!"; -- cgit v1.2.3-24-ge0c7