diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2009-08-12 22:48:21 +0200 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2009-08-12 22:48:21 +0200 |
commit | edd2d08a9aef32f442f43fb960a80680389b1685 (patch) | |
tree | 980cb0ea99dd0d34865a646a34b62b04015daddc /lib | |
parent | 981ee0ffb6dda1d61862cab3bd1b72fc68e6e796 (diff) |
Don't rely on file system to get object of Git tag.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LXRng/Repo/Git.pm | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |