[wp-hackers] WP 3.7 auto-update

Andrew Nacin wp at andrewnacin.com
Fri Oct 11 17:18:03 UTC 2013


On Fri, Oct 11, 2013 at 1:11 PM, Ryan McCue <lists at rotorised.com> wrote:

> WordPress will automatically detect if you're in a git/svn/hg/bzr
>  repository and not activate the upgrades if so. This should work for
> submodules too (submodules just have a .git file instead of a .git
> directory).
>

It actually uses is_dir() instead of file_exists(). But, we walk up the
directory tree to the very top of the disk. So if your submodule is /srv/
example.com/public_html/wordpress/, we'll look for a .git directory in
these places:

 * /srv/example.com/public_html/wordpress/.git (which will be a file)
 * /srv/example.com/public_html/.git
 * /srv/example.com/.git
 * /srv/.git
 * /.git

So basically: We won't notice your submodule, but we will notice your
submodule is part of a git repository.

If someone thinks we should use file_exists() instead, that's fine. I
wanted to avoid false positives with a file named .svn, .git, .hg, or .bzr,
but I had forgotten that submodules use a .git file, so it might be more
trouble than its worse.

Nacin


More information about the wp-hackers mailing list