Skip to contentSkip to conversation

gitweb: Use single implementation of export_ok check.

PATCH In review Alexander Gavrilov 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: Use single implementation of export_ok check.

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.

---

	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(-)
gitweb/gitweb.perl +1 -2
index c5254af..172ea6b 100755
@@ -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 {
Signature · 1 line
tg: (933bb3a..) t/authenticate/unify-exportok (depends on: vanilla/master)
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Alexander Gavrilov

GitWeb source contains a special function that implements the

s/GitWeb/gitweb/

Quoted 7 lines

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.

Signature · 2 lines
Jakub Narebski
Poland