about summary refs log tree commit homepage
path: root/lib/PublicInbox/ContentHash.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/ContentHash.pm')
-rw-r--r--lib/PublicInbox/ContentHash.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/ContentHash.pm b/lib/PublicInbox/ContentHash.pm
index 112b1ea6..cc4a54c9 100644
--- a/lib/PublicInbox/ContentHash.pm
+++ b/lib/PublicInbox/ContentHash.pm
@@ -97,9 +97,9 @@ sub content_hash ($) {
 sub git_sha ($$) {
         my ($n, $eml) = @_;
         my $dig = Digest::SHA->new($n);
-        my $buf = $eml->as_string;
-        $dig->add('blob '.length($buf)."\0");
-        $dig->add($buf);
+        my $bref = ref($eml) eq 'SCALAR' ? $eml : \($eml->as_string);
+        $dig->add('blob '.length($$bref)."\0");
+        $dig->add($$bref);
         $dig;
 }