Skip to content

Commit

Permalink
fixed git_blob in signature() to be consistent with previous versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Post committed Apr 13, 2011
1 parent 0e9b9ef commit 2f58be5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CachePipe.pm
Expand Up @@ -266,21 +266,19 @@ sub signature {
$length = length($content);
}

my $git_blob = 'blob' . ' ' . length($content) . "\\0" . $content;
my $git_blob = 'blob' . ' ' . length($content) . "\0" . $content;
my $tmpfile = ".tmp.$$";
open OUT, ">$tmpfile" or die;
print OUT $git_blob;
close(OUT);
chomp(my $sha1 = `cat $tmpfile | sha1sum -b | awk '{ print \$1 }'`);
# chomp(my $sha1 = `echo '$git_blob' | sha1sum -b | awk '{ print \$1 }'`);
unlink($tmpfile);
# print $sha1 . $/;
return $sha1;

# my $git_blob = 'blob' . ' ' . length($content) . "\0" . $content;
# my $sha = new Digest::SHA1();
# $sha->add($git_blob);
# print $sha->hexdigest() . $/;

return $sha1;
# return $sha->hexdigest() . $/;
}

sub mylog {
Expand Down

0 comments on commit 2f58be5

Please sign in to comment.