All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gavrilov <angavrilov@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>,
	Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
	Petr Baudis <pasky@suse.cz>
Subject: [PATCH] gitweb: Use single implementation of export_ok check.
Date: Thu, 6 Nov 2008 01:15:56 +0300	[thread overview]
Message-ID: <200811060115.57168.angavrilov@gmail.com> (raw)

GitWeb source contains a special function that implements the
export_ok check, but validate_project still uses a separate copy
of essentially the same code.

This patch makes it use the dedicated function, thus ensuring
that all checks are done through a single code path.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---

	For reference, here is the function:

	sub check_export_ok {
		my ($dir) = @_;
		return (check_head_link($dir) &&
			(!$export_ok || -e "$dir/$export_ok"));
	}


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

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c5254af..172ea6b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -742,8 +742,7 @@ sub validate_project {
 	my $input = shift || return undef;
 	if (!validate_pathname($input) ||
 		!(-d "$projectroot/$input") ||
-		!check_head_link("$projectroot/$input") ||
-		($export_ok && !(-e "$projectroot/$input/$export_ok")) ||
+		!check_export_ok("$projectroot/$input") ||
 		($strict_export && !project_in_list($input))) {
 		return undef;
 	} else {
-- 
tg: (933bb3a..) t/authenticate/unify-exportok (depends on: vanilla/master)

             reply	other threads:[~2008-11-05 22:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 22:15 Alexander Gavrilov [this message]
2008-11-05 22:41 ` [PATCH] gitweb: Use single implementation of export_ok check Jakub Narebski

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=200811060115.57168.angavrilov@gmail.com \
    --to=angavrilov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=giuseppe.bilotta@gmail.com \
    --cc=jnareb@gmail.com \
    --cc=pasky@suse.cz \
    /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.