function test_auto_push() { global $git; $this->assertEmpty($git->get_uncommited_changes()); $this->_add_changes_locally(); $this->assertCount(1, $git->get_uncommited_changes()); gitium_auto_push(); $this->assertEmpty($git->get_uncommited_changes()); }
function gitium_hook_plugin_and_theme_editor_page($hook) { switch ($hook) { case 'plugin-editor.php': if (isset($_GET['a']) && 'te' == $_GET['a']) { gitium_auto_push(); } break; case 'theme-editor.php': if (isset($_GET['updated']) && 'true' == $_GET['updated']) { gitium_auto_push(); } break; } return; }
function gitium_check_after_event($plugin, $event = 'activation') { global $git; if ('gitium/gitium.php' == $plugin) { return; } // do not hook on activation of this plugin if ($git->is_dirty()) { $versions = gitium_update_versions(); if (isset($versions['plugins'][$plugin])) { $name = $versions['plugins'][$plugin]['name']; $version = $versions['plugins'][$plugin]['version']; } else { $name = $plugin; } gitium_auto_push(_gitium_format_message($name, $version, "after {$event} of")); } }