Move Repository->hash_by_path to Commit->sha_by_path.
[catagits/Gitalist.git] / lib / Gitalist / Git / Repository.pm
index 941a4a0..06d3914 100644 (file)
@@ -108,18 +108,6 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils {
         );
     }
 
-    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)
-            or return;
-        my $line = $paths[0];
-
-        #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
-        $line =~ m/^([0-9]+) (.+) ($SHA1RE)\t/;
-        return $3;
-    }
-
     method list_revs ( NonEmptySimpleStr :$sha1!,
                        Int :$count?,
                        Int :$skip?,
@@ -399,10 +387,6 @@ Each item is a L<Gitalist::Git::Object>.
 
 Return an appropriate subclass of L<Gitalist::Git::Object> for the given sha1.
 
-=head2 hash_by_path ($commit, $path)
-
-Returns the tree/file sha1 for a given path in a commit.
-
 =head2 list_revs ($sha1, $count?, $skip?, \%search?, $file?)
 
 Returns a list of revs for the given head ($sha1).