]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
git: remove src_blob_url
[public-inbox.git] / lib / PublicInbox / Git.pm
index d048051ea1e48479d0585ae2df04fa0a67aaa681..218846f3d1d25d42699a4a4be55351394c6a5341 100644 (file)
@@ -12,6 +12,7 @@ use warnings;
 use POSIX qw(dup2);
 require IO::Handle;
 use PublicInbox::Spawn qw(spawn popen_rd);
+use PublicInbox::Tmpfile;
 use base qw(Exporter);
 our @EXPORT_OK = qw(git_unquote git_quote);
 
@@ -110,7 +111,8 @@ sub _bidi_pipe {
                        qw(-c core.abbrev=40 cat-file), $batch);
        my $redir = { 0 => fileno($out_r), 1 => fileno($in_w) };
        if ($err) {
-               open(my $fh, '+>', undef) or fail($self, "open.err failed: $!");
+               my $id = "git.$self->{git_dir}$batch.err";
+               my $fh = tmpfile($id) or fail($self, "tmpfile($id): $!");
                $self->{$err} = $fh;
                $redir->{2} = fileno($fh);
        }
@@ -259,17 +261,6 @@ sub local_nick ($) {
        wantarray ? ($ret) : $ret;
 }
 
-# show the blob URL for cgit/gitweb/whatever
-sub src_blob_url {
-       my ($self, $oid) = @_;
-       # blob_url_format = "https://example.com/foo.git/blob/%s"
-       if (my $bfu = $self->{blob_url_format}) {
-               return map { sprintf($_, $oid) } @$bfu if wantarray;
-               return sprintf($bfu->[0], $oid);
-       }
-       local_nick($self);
-}
-
 sub host_prefix_url ($$) {
        my ($env, $url) = @_;
        return $url if index($url, '//') >= 0;