Re: [PATCH 1/3] t9400: Add test cases for config file handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This part seems to fail for me and gets an "unexpected cvs success".

+rm -fr cvswork2
+test_expect_success 'gitcvs.ext.enabled = false' \
+  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
+   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   then
+     echo unexpected cvs success
+     false
+   else
+     true
+   fi &&
+   cat cvs.log | grep -q "GITCVS emulation disabled" &&
+   test ! -d cvswork2'
+

I think the per-method enablement logic is not quite right.

-- >8 --
git-cvsserver: ignore global config when per-method config disables an access.

When the per-method enable logic disables the access, we should
not even look at the global one.

 git-cvsserver.perl |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index fcfb99d..1de5177 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -192,11 +192,9 @@ sub req_Root
         }
     }
 
-    unless ( ($cfg->{gitcvs}{$state->{method}}{enabled}
-	      and $cfg->{gitcvs}{$state->{method}}{enabled} =~ /^\s*(1|true|yes)\s*$/i)
-	     or ($cfg->{gitcvs}{enabled}
-	      and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i) )
-    {
+    my $enabled = ($cfg->{gitcvs}{$state->{method}}{enabled}
+		   || $cfg->{gitcvs}{enabled});
+    unless ($enabled && $enabled =~ /^\s*(1|true|yes)\s*$/i) {
         print "E GITCVS emulation needs to be enabled on this repo\n";
         print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n";
         print "E \n";

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux