From: Max Semenik Date: Fri, 29 Jun 2012 20:04:42 +0000 (+0400) Subject: Bug 36453 - Provide the git info on action=query&meta=siteinfo X-Git-Tag: 1.31.0-rc.0~23185^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=dd6519709b865b483c2fef32d58074c155f93ba8;p=lhc%2Fweb%2Fwiklou.git Bug 36453 - Provide the git info on action=query&meta=siteinfo Change-Id: I3d6c79d0d2cafd533f39e255940869087778d884 --- diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index e7102e0011..38e37c0186 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -121,9 +121,14 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['dbtype'] = $GLOBALS['wgDBtype']; $data['dbversion'] = $this->getDB()->getServerVersion(); - $svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] ); - if ( $svn ) { - $data['rev'] = $svn; + $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] ); + if ( $git ) { + $data['git-hash'] = $git; + } else { + $svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] ); + if ( $svn ) { + $data['rev'] = $svn; + } } // 'case-insensitive' option is reserved for future