Skip to content

Commit 15c54fe

Browse files
jnarebgitster
authored andcommitted
gitweb: Remove unused $hash_base parameter from normalize_link_target
...since it was decided for normalize_link_target to only mangle pathname, and do not try to check if target is present in $hash_base tree, for performance reasons. Signed-off-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 095e914 commit 15c54fe

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

gitweb/gitweb.perl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,10 +3339,7 @@ sub git_get_link_target {
33393339
# return target of link relative to top directory (top tree);
33403340
# return undef if it is not possible (including absolute links).
33413341
sub normalize_link_target {
3342-
my ($link_target, $basedir, $hash_base) = @_;
3343-
3344-
# we can normalize symlink target only if $hash_base is provided
3345-
return unless $hash_base;
3342+
my ($link_target, $basedir) = @_;
33463343

33473344
# absolute symlinks (beginning with '/') cannot be normalized
33483345
return if (substr($link_target, 0, 1) eq '/');
@@ -3398,7 +3395,7 @@ sub git_print_tree_entry {
33983395
if (S_ISLNK(oct $t->{'mode'})) {
33993396
my $link_target = git_get_link_target($t->{'hash'});
34003397
if ($link_target) {
3401-
my $norm_target = normalize_link_target($link_target, $basedir, $hash_base);
3398+
my $norm_target = normalize_link_target($link_target, $basedir);
34023399
if (defined $norm_target) {
34033400
print " -> " .
34043401
$cgi->a({-href => href(action=>"object", hash_base=>$hash_base,

0 commit comments

Comments
 (0)