diff options
Diffstat (limited to 'lib/PublicInbox/Repo.pm')
-rw-r--r-- | lib/PublicInbox/Repo.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/PublicInbox/Repo.pm b/lib/PublicInbox/Repo.pm index ceebe5c4..f0cb4b3d 100644 --- a/lib/PublicInbox/Repo.pm +++ b/lib/PublicInbox/Repo.pm @@ -46,4 +46,15 @@ sub cloneurl { $self->{cloneurl} = $url; } +sub tip { + my ($self) = @_; + $self->{-tip} ||= do { + if ($self->{vcs} eq 'git') { + my $t = $self->{git}->qx(qw(symbolic-ref --short HEAD)); + chomp $t; + $t; + } + }; +} + 1; |