$recursiveGit($repository, 'pull', [$remote, $branch], 'pull'); } } elseif ($_POST['pull_push'] == 'push') { if (is_dir($currentGitDir . '/extras')) { $lrepo = new GitRepo($currentGitDir . '/extras', $currentGitDir); $lrepo->run('add --ignore-removal .'); $lrepo->run('commit -m "update extras"'); $logs = array_merge($logs, $lrepo->getLogs()); } if ($github) { $pushUrl = 'https://' . $github['token'] . '@github.com/' . $githubUser . '/' . $githubRepo . '.git'; $repo->run('push --tags ' . escapeshellarg($pushUrl) . ' --repo=' . escapeshellarg($remote) . ' ' . escapeshellarg($branch)); if ($pull_push_recursive) { $recursiveGit($repository, function ($lrepo, $args) use($github, $githubUserRepo) { list($remote, $branch) = $args; list($githubUser, $githubRepo) = $githubUserRepo($lrepo->git_directory_path()); $pushUrl = 'https://' . $github['token'] . '@github.com/' . $githubUser . '/' . $githubRepo . '.git'; $lrepo->run('push --tags ' . escapeshellarg($pushUrl) . ' --repo=' . escapeshellarg($remote) . ' ' . escapeshellarg($branch)); }, [$remote, $branch], 'push'); } } else { $repo->push($remote, $branch); if ($pull_push_recursive) { $recursiveGit($repository, 'push', [$remote, $branch], 'push'); } } } } if (isset($_POST['exclude'])) { file_put_contents($currentGitDir . '/info/exclude', $_POST['exclude']); }