From 647c407b6cbee56256b6c75706fb3a5660e80056 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 20 Nov 2020 17:11:24 -0800 Subject: [PATCH] Re-create missing git dir https://github.com/virtualmin/virtualmin-gpl/issues/232 --- virtualmin-git-lib.pl | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/virtualmin-git-lib.pl b/virtualmin-git-lib.pl index 51f7f3a..8d71e65 100644 --- a/virtualmin-git-lib.pl +++ b/virtualmin-git-lib.pl @@ -67,7 +67,7 @@ sub create_rep # Make the dir and setup a repo in it $rep->{'dir'} = &virtual_server::public_html_dir($d)."/git/$rep->{'rep'}.git"; if (!-d $rep->{'dir'}) { - &virtual_server::make_dir_as_domain_user($d, $rep->{'dir'}); + &virtual_server::make_dir_as_domain_user($d, $rep->{'dir'}, undef, 1); } my $cmd = "cd ".quotemeta($rep->{'dir'})." && $git --bare init"; my ($out, $ex) = &virtual_server::run_as_domain_user($d, $cmd); @@ -125,25 +125,14 @@ sub find_gitweb { my $ver = &get_git_version(); my $localcgi = "gitweb.cgi.source"; -if ($ver >= 1.7) { +if (&compare_version_numbers($ver, 1.7) >= 0) { $localcgi .= ".new"; } foreach my $p ("/var/www/git/gitweb.cgi", # CentOS "/usr/lib/cgi-bin/gitweb.cgi", # Ubuntu "$module_root_directory/$localcgi") { if (-r $p) { - # Exists .. but does it use a stupid static/ path? - my $lref = &read_file_lines($p, 1); - my $static = 0; - foreach my $l (@$lref) { - if ($l =~ /\@stylesheets\s*=.*static\//) { - $static = 1; - } - } - &unflush_file_lines($p); - if (!$static) { - return $p; - } + return $p; } } return undef;