};
if ($dir) {
- $opts{Repository} = abs_path($dir);
+ $dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
+ $opts{Repository} = $dir;
# If --git-dir went ok, this shouldn't die either.
my $prefix = $search->command_oneline('rev-parse', '--show-prefix');
=cut
-# Implemented in Git.xs.
+sub hash_object {
+ my ($self, $type, $file) = _maybe_self(@_);
+
+ # hash_object_* implemented in Git.xs.
+
+ if (ref($file) eq 'GLOB') {
+ my $hash = hash_object_pipe($type, fileno($file));
+ close $file;
+ return $hash;
+ } else {
+ hash_object_file($type, $file);
+ }
+}