aboutsummaryrefslogtreecommitdiffstats
path: root/lib/LXRng/Repo/Git.pm
diff options
context:
space:
mode:
authorArne Georg Gleditsch <argggh@lxr.linpro.no>2007-11-15 21:51:00 +0100
committerArne Georg Gleditsch <argggh@lxr.linpro.no>2007-11-15 21:51:00 +0100
commit8c978d76179b4f573c1eb9b9bb9db966c81330bb (patch)
treeade066d6c36105de19e2a826188d0f1c14818f59 /lib/LXRng/Repo/Git.pm
parente9fa4c98bb5f084739d3418ade3f0c51e34a0aa1 (diff)
Too many changes...
Diffstat (limited to 'lib/LXRng/Repo/Git.pm')
-rw-r--r--lib/LXRng/Repo/Git.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/LXRng/Repo/Git.pm b/lib/LXRng/Repo/Git.pm
index 2d6ea33..757da26 100644
--- a/lib/LXRng/Repo/Git.pm
+++ b/lib/LXRng/Repo/Git.pm
@@ -74,7 +74,7 @@ sub allversions {
}
sub node {
- my ($self, $path, $release) = @_;
+ my ($self, $path, $release, $rev) = @_;
$path =~ s,^/+,,;
$path =~ s,/+$,,;
@@ -88,14 +88,21 @@ sub node {
return LXRng::Repo::Git::Directory->new($self, '', $ref);
}
- my $git = $self->_git_cmd('ls-tree', $release, $path);
- my ($mode, $type, $ref, $gitpath) = split(" ", <$git>);
+ my $type;
+ if ($rev) {
+ $type = 'blob';
+ }
+ else {
+ my $git = $self->_git_cmd('ls-tree', $release, $path);
+ my ($mode, $gitpath);
+ ($mode, $type, $rev, $gitpath) = split(" ", <$git>);
+ }
if ($type eq 'tree') {
- return LXRng::Repo::Git::Directory->new($self, $path, $ref, $release);
+ return LXRng::Repo::Git::Directory->new($self, $path, $rev, $release);
}
elsif ($type eq 'blob') {
- return LXRng::Repo::Git::File->new($self, $path, $ref, $release);
+ return LXRng::Repo::Git::File->new($self, $path, $rev, $release);
}
else {
return undef;