API: Expose git branch in siteinfo
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index e61d17a..41847dc 100644 (file)
@@ -1113,6 +1113,15 @@ class SpecialVersion extends SpecialPage {
                return $repo->getHeadSHA1();
        }
 
+       /**
+        * @param string $dir Directory of the git checkout
+        * @return bool|string Branch currently checked out
+        */
+       public static function getGitCurrentBranch( $dir ) {
+               $repo = new GitInfo( $dir );
+               return $repo->getCurrentBranch();
+       }
+
        /**
         * Get the list of entry points and their URLs
         * @return string Wikitext