]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
solver: support sha256 coderepos
[public-inbox.git] / lib / PublicInbox / Git.pm
index 4078dd5b7cfe79f8bf1c0d29cfbe4b3cba35aae5..54ceaf0b8a5d6935f9101dbf52a45c4155eeb90f 100644 (file)
@@ -71,7 +71,7 @@ sub new {
 
 sub git_path ($$) {
        my ($self, $path) = @_;
-       $self->{-git_path}->{$path} ||= do {
+       $self->{-git_path}->{$path} //= do {
                local $/ = "\n";
                chomp(my $str = $self->qx(qw(rev-parse --git-path), $path));
 
@@ -94,6 +94,13 @@ sub alternates_changed {
        $self->{alt_st} = $st; # always a true value
 }
 
+sub object_format {
+       $_[0]->{object_format} //= do {
+               my $fmt = $_[0]->qx(qw(config extensions.objectformat));
+               $fmt eq "sha256\n" ? \'sha256' : \undef;
+       }
+}
+
 sub last_check_err {
        my ($self) = @_;
        my $fh = $self->{err_c} or return;