git-config should work even if description is set!

the optimisation that I just broke here was responsible for a bug that
ignores config entries if you also had a description there

    repo @all
        config foo.bar.testAAA = "testAAA"

    repo	foo1 foo2
        RW+	= u1 u2
        R	= gitweb

    foo1 "sitaram" = "some project"

This is because the %git_configs hash has been wiped out earlier (when
can_read($repo, "gitweb") was first called) yet now you're not giving it
a chance to get filled because $desc short-circuits can_read.

(incidentally, this is one of those things that makes g3 so nice in
comparision, because I decided not to be so fixated on efficiency!)
This commit is contained in:
Sitaram Chamarty 2012-04-13 05:07:22 +05:30
parent d59bc351f8
commit f73e3d70d0

View file

@ -585,7 +585,7 @@ sub setup_gitweb_access
system("git config --remove-section gitweb 2>/dev/null");
}
return ($desc or can_read($repo, 'gitweb'));
return (can_read($repo, 'gitweb') or $desc);
# this return value is used by the caller to write to projects.list
}