From: Bryan Davis Date: Tue, 6 May 2014 19:15:09 +0000 (-0600) Subject: Check for valid git repository in GitInfo::getHeadCommitDate X-Git-Tag: 1.31.0-rc.0~15861 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=831265410ec45131470e9f12415198c9e407b132;p=lhc%2Fweb%2Fwiklou.git Check for valid git repository in GitInfo::getHeadCommitDate Ensure that GitInfo::getHead returns a valid value before attempting to use the git binary to extract a commit date. Bug: 64948 Change-Id: Ib0d245306842706dbb5d4b9522bb381a5f55526c --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index dc2fff1398..304c1bce30 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -195,7 +195,10 @@ class GitInfo { if ( !isset( $this->cache['headCommitDate'] ) ) { $date = false; - if ( is_file( $wgGitBin ) && is_executable( $wgGitBin ) ) { + if ( is_file( $wgGitBin ) && + is_executable( $wgGitBin ) && + $this->getHead() !== false + ) { $environment = array( "GIT_DIR" => $this->basedir ); $cmd = wfEscapeShellArg( $wgGitBin ) . " show -s --format=format:%ct HEAD";