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
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";