All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 4/4] gitweb: Remove unused $hash_base parameter from normalize_link_target
Date: Mon, 11 May 2009 19:45:11 +0200	[thread overview]
Message-ID: <20090511174253.15152.8987.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090511173025.15152.94215.stgit@localhost.localdomain>

...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 <jnareb@gmail.com>
---
This was caugth by Perl::Critic::Policy::Variables::ProhibitReusedNames 
 - Do not reuse a variable name in a lexical scope.

(That was probably me that forgot to remove parameter, but I didn't
search for authorship of this fragment.)

 gitweb/gitweb.perl |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c72ae10..05702e4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3339,10 +3339,7 @@ sub git_get_link_target {
 # return target of link relative to top directory (top tree);
 # return undef if it is not possible (including absolute links).
 sub normalize_link_target {
-	my ($link_target, $basedir, $hash_base) = @_;
-
-	# we can normalize symlink target only if $hash_base is provided
-	return unless $hash_base;
+	my ($link_target, $basedir) = @_;
 
 	# absolute symlinks (beginning with '/') cannot be normalized
 	return if (substr($link_target, 0, 1) eq '/');
@@ -3398,7 +3395,7 @@ sub git_print_tree_entry {
 		if (S_ISLNK(oct $t->{'mode'})) {
 			my $link_target = git_get_link_target($t->{'hash'});
 			if ($link_target) {
-				my $norm_target = normalize_link_target($link_target, $basedir, $hash_base);
+				my $norm_target = normalize_link_target($link_target, $basedir);
 				if (defined $norm_target) {
 					print " -> " .
 					      $cgi->a({-href => href(action=>"object", hash_base=>$hash_base,

      parent reply	other threads:[~2009-05-11 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 17:36 [PATCH 0/4] gitweb: Some code cleanups, part 2 (low hanging fruit) Jakub Narebski
2009-05-11 17:37 ` [PATCH 1/4] gitweb: Replace wrongly added tabs with spaces Jakub Narebski
2009-05-11 17:39 ` [PATCH 2/4] gitweb: Use capturing parentheses only when you intend to capture Jakub Narebski
2009-05-11 17:42 ` [PATCH 3/4] gitweb: Simplify snapshot format detection logic in evaluate_path_info Jakub Narebski
2009-05-11 17:52   ` Giuseppe Bilotta
2009-05-11 17:45 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090511174253.15152.8987.stgit@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.