From dd6519709b865b483c2fef32d58074c155f93ba8 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Sat, 30 Jun 2012 00:04:42 +0400 Subject: [PATCH] Bug 36453 - Provide the git info on action=query&meta=siteinfo Change-Id: I3d6c79d0d2cafd533f39e255940869087778d884 --- includes/api/ApiQuerySiteinfo.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 -- 2.20.1