From edd2d08a9aef32f442f43fb960a80680389b1685 Mon Sep 17 00:00:00 2001 From: Arne Georg Gleditsch Date: Wed, 12 Aug 2009 22:48:21 +0200 Subject: Don't rely on file system to get object of Git tag. --- lib/LXRng/Repo/Git.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/LXRng/Repo/Git.pm b/lib/LXRng/Repo/Git.pm index 7407ca0..946c73f 100644 --- a/lib/LXRng/Repo/Git.pm +++ b/lib/LXRng/Repo/Git.pm @@ -112,10 +112,10 @@ sub node { $path =~ s,/+$,,; if ($path eq '') { - open(my $tag, '<', $$self{'root'}.'/refs/tags/'.$release) - or return undef; - my $ref = <$tag>; - close($tag); + my $git = $self->_git_cmd('rev-list', '--max-count=1', $release); + my $ref = <$git>; + return undef unless $git =~ /\S/; + close($git); chomp($ref); return LXRng::Repo::Git::Directory->new($self, '', $ref); } -- cgit v1.2.3