Bug 36453 - Provide the git info on action=query&meta=siteinfo
authorMax Semenik <maxsem.wiki@gmail.com>
Fri, 29 Jun 2012 20:04:42 +0000 (00:04 +0400)
committerMax Semenik <maxsem.wiki@gmail.com>
Fri, 29 Jun 2012 20:04:42 +0000 (00:04 +0400)
Change-Id: I3d6c79d0d2cafd533f39e255940869087778d884

includes/api/ApiQuerySiteinfo.php

index e7102e0..38e37c0 100644 (file)
@@ -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