On a VM (VirtualBox with Vagrant) we had a case that 'locate' was not returning the folders containing a .git folder, thus resulting in the message that no Git repos where found.

When replacing it with 'find' it had no issues and the report was returning the results as expected.

If we use 'find' in case the 'locate' remains empty, we have a higher probability of getting results.

CommentFileSizeAuthor
#4 find_as_fallback-3076204-4.patch1.59 KBlolandese

Comments

lolandese created an issue. See original summary.

lolandese’s picture

Command used:

find "$PWD" -name "*.git" -type d | grep -e ".git$" | sort'

To insert also the escapeshellcmd($extra_folders), we should make sure not to suffix them with '*/.git ' in that case.

lolandese’s picture

We checked the answer of 14.04 - Locate does not locate files - Ask Ubuntu but that was not the issue.

At least it shows there are environment settings that might be in play, showing the need for a fallback method.

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new1.59 KB

  • lolandese committed 175aea7 on 8.x-1.x
    Issue #3076204 by lolandese: Use 'find' as fallback for 'locate'
    
lolandese’s picture

Status: Needs review » Fixed
  • Passes CodeSniffer without errors.
  • Shows the Git info report as expected on a VM running through vagrant where 'locate' did not work.
  • Tested also by defining some extra folders apart from the Drupal root.
  • Tested also a project where 'locate' works on a native LAMP without a fallback.

All fine.

Status: Fixed » Closed (fixed)

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