X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FGit%2FRepository.pm;h=941a4a00945452d246a28e72a5ffae1f5bbbbe3d;hb=e311fd9e4aba5cf62379c7bb498a649801e024e4;hp=bcb36faaec886622eba51b1537479b22d218cd66;hpb=acd0be236236c36b70c5e03de2e75179024e2918;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Git/Repository.pm b/lib/Gitalist/Git/Repository.pm index bcb36fa..941a4a0 100644 --- a/lib/Gitalist/Git/Repository.pm +++ b/lib/Gitalist/Git/Repository.pm @@ -108,7 +108,7 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils { ); } - method hash_by_path ($base, $path = '', $type?) { + method hash_by_path ($base, $path) { $path =~ s{/+$}(); # FIXME should this really just take the first result? my @paths = $self->run_cmd('ls-tree', $base, '--', $path) @@ -117,9 +117,7 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils { #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c' $line =~ m/^([0-9]+) (.+) ($SHA1RE)\t/; - return defined $type && $type ne $2 - ? () - : $3; + return $3; } method list_revs ( NonEmptySimpleStr :$sha1!, @@ -401,9 +399,9 @@ Each item is a L. Return an appropriate subclass of L for the given sha1. -=head2 hash_by_path ($sha1, $path, $type?) +=head2 hash_by_path ($commit, $path) -Returns the sha1 for a given path, optionally limited by type. +Returns the tree/file sha1 for a given path in a commit. =head2 list_revs ($sha1, $count?, $skip?, \%search?, $file?)