I saw this PHP warning on an Acquia cloud site:

Warning: file(/.git/HEAD) [function.file]: failed to open stream: No such file or directory in environment_indicator_environment_indicator_matched_indicator_alter()

The new git branch code is checking if git exists, but not confirming if there is a git repo, so it fails to find a $git_path and produces the above PHP warning.

CommentFileSizeAuthor
#1 no-git-repo.patch2.15 KBJohnAlbin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin’s picture

Status: Active » Needs review
FileSize
2.15 KB

Needs review. I cleaned up some other code, but didn't actually test it, fyi.

JohnAlbin’s picture

Title: PHP Warnings when git is installed, but there's no git repo » PHP Warning when git is installed and there's no git repo

  • Commit 5f01a09 on 7.x-2.x authored by JohnAlbin, committed by e0ipso:
    Issue #2225703 by johnalbin: Suppress PHP warning because of the git...
e0ipso’s picture

Status: Needs review » Fixed

I had to modify the code slightly, but it's already committed.

Thanks for contributing John!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.