lib/PublicInbox/RepoGitSearch.pm
lib/PublicInbox/RepoGitSearchIdx.pm
lib/PublicInbox/RepoGitSnapshot.pm
+lib/PublicInbox/RepoGitSrc.pm
lib/PublicInbox/RepoGitSummary.pm
lib/PublicInbox/RepoGitTag.pm
-lib/PublicInbox/RepoGitTree.pm
lib/PublicInbox/RepoRoot.pm
lib/PublicInbox/Repobrowse.pm
lib/PublicInbox/SaPlugin/ListMirror.pm
t/repobrowse_git_log.t
t/repobrowse_git_raw.t
t/repobrowse_git_snapshot.t
-t/repobrowse_git_tree.t
+t/repobrowse_git_src.t
t/search.t
t/spamcheck_spamc.t
t/spawn.t
my $rel = $req->{relcmd};
my $x = $self->html_start($req, $s) . "\n" .
qq( commit $H (<a\nhref="${rel}patch/$H">patch</a>)\n) .
- qq( tree <a\nrel=nofollow\nhref="${rel}tree/$H">$t</a>);
+ qq( tree <a\nrel=nofollow\nhref="${rel}src/$H">$t</a>);
my $git = $req->{-repo}->{git};
# extra show path information, if any
my $e = PublicInbox::Hval->utf8($_, join('/', @t));
$ep = $e->as_path;
my $eh = $e->as_html;
- $ep = "${rel}tree/$ep/$H";
+ $ep = "${rel}src/$ep/$H";
qq(<a\nrel=nofollow\nhref="$ep">$eh</a>);
} @$extra);
$path = "/$ep";
$p = $p->as_path;
$fn = utf8_html($fn);
$$dst .= qq(\t<a\nrel=nofollow);
- $$dst .= qq(\nid="$anchor"\nhref="${rel}tree/$p">);
+ $$dst .= qq(\nid="$anchor"\nhref="${rel}src/$p">);
$$dst .= "$fn</a>\n";
}
}
$na = defined $na ? "#n$na" : '';
my $p = $req->{p}->[0];
$rv .= qq(<a\nrel=nofollow);
- $rv .= qq(\nhref="${rel}tree/$p/$req->{path_a}$na">);
+ $rv .= qq(\nhref="${rel}src/$p/$req->{path_a}$na">);
$rv .= "$ca</a>";
}
$rv .= ' ';
} else {
$nb = defined $nb ? "#n$nb" : '';
$rv .= qq(<a\nrel=nofollow);
- $rv .= qq(\nhref="${rel}tree/$req->{-tip}/$req->{path_b}$nb">);
+ $rv .= qq(\nhref="${rel}src/$req->{-tip}/$req->{path_b}$nb">);
$rv .= "$cb</a>";
}
$rv . ' @@' . utf8_html($ctx);
}
}
- # we can use the normal 'tree' endpoint for the result
+ # we can use the normal 'src' endpoint for the result
my ($n) = ($last =~ /\A\+(\d+)/); # line number
if ($n == 0) { # deleted file (does this happen with --cc?)
$rv .= " $last";
} else {
my $H = $req->{H};
$rv .= qq( <a\nrel=nofollow);
- $rv .= qq(\nhref="${rel}tree/$H/$path#n$n">$last</a>);
+ $rv .= qq(\nhref="${rel}src/$H/$path#n$n">$last</a>);
}
$rv .= " $at" . utf8_html($ctx);
}
# Copyright (C) 2015 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-package PublicInbox::RepoGitTree;
+package PublicInbox::RepoGitSrc;
use strict;
use warnings;
use base qw(PublicInbox::RepoBase);
my $MAX_ASYNC = 65536; # same as pipe size on Linux
my $BIN_DETECT = 8000; # same as git (buffer_is_binary in git.git)
-sub call_git_tree {
+sub call_git_src {
my ($self, $req) = @_;
my $repo = $req->{-repo};
my $git = $repo->{git};
my $rel = $req->{relcmd};
# avoid relative paths, here, we don't want to propagate
# trailing-slash URLs although we tolerate them
- $s = "<a\nhref=\"${rel}tree/$tip\">root</a>/";
+ $s = "<a\nhref=\"${rel}src/$tip\">root</a>/";
my $cur = pop @ex;
my @t;
$s .= join('/', (map {
my $e = PublicInbox::Hval->utf8($_, join('/', @t));
my $ep = $e->as_path;
my $eh = $e->as_html;
- "<a\nhref=\"${rel}tree/$tip/$ep\">$eh</a>";
+ "<a\nhref=\"${rel}src/$tip/$ep\">$eh</a>";
} @ex), '<b>'.utf8_html($cur).'</b>');
}
} elsif (defined(my $tip = $req->{tip})) {
$pfx = $tip;
} else {
- $pfx = 'tree/' . $req->{-repo}->tip;
+ $pfx = 'src/' . $req->{-repo}->tip;
}
$req->{tpfx} = $pfx;
my $env = $req->{env};
my ($req, $rel, $readme) = @_;
my @path = split(m!/+!, $readme);
my $tip = $req->{-repo}->tip;
- my $s = "tree <a\nhref=\"${rel}tree/$tip\">root</a>/";
+ my $s = "tree <a\nhref=\"${rel}src/$tip\">root</a>/";
my @t;
$s .= join('/', (map {
push @t, $_;
my $e = PublicInbox::Hval->utf8($_, join('/', @t));
my $ep = $e->as_path;
my $eh = $e->as_html;
- $e = "<a\nhref=\"${rel}tree/$tip/$ep\">$eh</a>";
+ $e = "<a\nhref=\"${rel}src/$tip/$ep\">$eh</a>";
# bold the last one
scalar(@t) == scalar(@path) ? "<b>$e</b>" : $e;
} @path));
use warnings;
use PublicInbox::RepoConfig;
-my %CMD = map { lc($_) => $_ } qw(Log Commit Tree Patch Blob Raw Tag Atom
+my %CMD = map { lc($_) => $_ } qw(Log Commit Src Patch Blob Raw Tag Atom
Diff Snapshot);
my %VCS = (git => 'Git');
my %LOADED;
}
# URL syntax: / repo [ / cmd [ / head [ / path ] ] ]
- # cmd: log | commit | diff | tree | view | blob | snapshot
+ # cmd: log | commit | diff | src | view | blob | snapshot
# repo and path (@extra) may both contain '/'
my $path_info = $env->{PATH_INFO};
my (undef, $repo_path, @extra) = split(m{/+}, $path_info, -1);
test_psgi($test->{app}, sub {
my ($cb) = @_;
- my $req = 'http://example.com/test.git/tree/HEAD/dir';
+ my $req = 'http://example.com/test.git/src/HEAD/dir';
my $res = $cb->(GET($req));
is(200, $res->code, 'got 200 response from dir');
my $noslash_body = dechunk($res);
is(301, $r2->code, 'got 301 response from dir with slash');
is($req, $r2->header('Location'), 'redirected w/o slash');
- $req = 'http://example.com/test.git/tree/master/foo.txt';
+ $req = 'http://example.com/test.git/src/master/foo.txt';
my $blob = $cb->(GET($req));
is($blob->header('Content-Type'), 'text/html; charset=UTF-8',
'got text/html blob');