Disable gitweb support when gitweb.type=disabled

Currently GitwebCgiConfig looks for and tries to run gitweb
unless gitweb has been disabled by explicitly setting gitweb.url
or gitweb.cgi to the empty string.

Disabling web links by setting gitweb.type=disabled conveys the
same intent.  Treat that setting in the same way.

Change-Id: I3c58f0c6a5dd5eec25c9c889c68fb909cd6518d5
This commit is contained in:
Jonathan Nieder
2016-06-11 19:06:16 -07:00
parent 308b02181c
commit 7635765a6d

View File

@@ -42,7 +42,8 @@ public class GitwebConfig {
public static boolean isDisabled(Config cfg) {
return isEmptyString(cfg, "gitweb", null, "url")
|| isEmptyString(cfg, "gitweb", null, "cgi");
|| isEmptyString(cfg, "gitweb", null, "cgi")
|| "disabled".equals(cfg.getString("gitweb", null, "type"));
}
public static class LegacyModule extends AbstractModule {