Fix currentHashes for empty $paths.

This commit is contained in:
Daniel James
2015-06-03 23:20:19 +01:00
parent 549254935b
commit 8daf424f49
2 changed files with 5 additions and 3 deletions

View File

@@ -126,8 +126,8 @@ class LocalMirror {
$child_repos = [];
foreach(SuperProject::readSubmoduleConfig($dst_dir) as $name => $values) {
if (empty($values['path']) { throw \RuntimeException("Missing path.");
if (empty($values['url']) { throw \RuntimeException("Missing URL.");
if (empty($values['path'])) { throw \RuntimeException("Missing path."); }
if (empty($values['url'])) { throw \RuntimeException("Missing URL."); }
$child_repos[$values['path']] = self::resolveGithubUrl($values['url'], $repo);
}

View File

@@ -176,8 +176,10 @@ class SuperProject extends Repo {
* @return Array
*/
static function currentHashes($repo_path, $paths, $ref = 'HEAD') {
$matches = null;
$hashes = Array();
if (!$paths) { return $hashes; }
$matches = null;
foreach (Process::read_lines(
"git ls-tree {$ref} ". implode(' ', $paths),
$repo_path) as $line)