aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-10-12 15:15:40 +0000
committerMario <mario@mariovavti.com>2024-10-12 15:15:40 +0000
commit05a5b644bf043aee941d17ac3fb254c99b1c64d1 (patch)
tree982b728a449956278a1f28296eeed89aead9e99d /library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php
parent84556854e858a8fafb208f796a298821e1ed2e91 (diff)
parentb117cf9dc71a2042b27420b9a713ac69514f469e (diff)
downloadvolse-hubzilla-05a5b644bf043aee941d17ac3fb254c99b1c64d1.tar.gz
volse-hubzilla-05a5b644bf043aee941d17ac3fb254c99b1c64d1.tar.bz2
volse-hubzilla-05a5b644bf043aee941d17ac3fb254c99b1c64d1.zip
Merge branch 'remove-repo-handling-from-admin-addons' into 'dev'
Remove addon repo management from admin/addons. See merge request hubzilla/core!2149
Diffstat (limited to 'library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php')
-rw-r--r--library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php129
1 files changed, 0 insertions, 129 deletions
diff --git a/library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php b/library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php
deleted file mode 100644
index 7516b360c..000000000
--- a/library/kzykhys/git/src/PHPGit/Command/RebaseCommand.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-
-namespace PHPGit\Command;
-
-use PHPGit\Command;
-use Symfony\Component\OptionsResolver\OptionsResolverInterface;
-
-/**
- * Forward-port local commits to the updated upstream head - `git rebase`
- *
- * @author Kazuyuki Hayashi <hayashi@valnur.net>
- */
-class RebaseCommand extends Command
-{
-
- /**
- * Forward-port local commits to the updated upstream head
- *
- * ``` php
- * $git = new PHPGit\Git();
- * $git->setRepository('/path/to/repo');
- * $git->fetch('origin');
- * $git->rebase('origin/master');
- * ```
- *
- * ##### Options
- *
- * - **onto** (_string_) Starting point at which to create the new commits
- * - **no-verify** (_boolean_) Bypasses the pre-rebase hook
- * - **force-rebase** (_boolean_) Force the rebase even if the current branch is a descendant of the commit you are rebasing onto
- *
- * @param string $upstream [optional] Upstream branch to compare against
- * @param string $branch [optional] Working branch; defaults to HEAD
- * @param array $options [optional] An array of options {@see RebaseCommand::setDefaultOptions}
- *
- * @return bool
- */
- public function __invoke($upstream = null, $branch = null, array $options = array())
- {
- $options = $this->resolve($options);
- $builder = $this->git->getProcessBuilder()
- ->add('rebase');
-
- if ($options['onto']) {
- $builder->add('--onto')->add($options['onto']);
- }
-
- if ($upstream) {
- $builder->add($upstream);
- }
-
- if ($branch) {
- $builder->add($branch);
- }
-
- $this->git->run($builder->getProcess());
-
- return true;
- }
-
- /**
- * Restart the rebasing process after having resolved a merge conflict
- *
- * @return bool
- */
- public function continues()
- {
- $builder = $this->git->getProcessBuilder()
- ->add('rebase')
- ->add('--continue');
-
- $this->git->run($builder->getProcess());
-
- return true;
- }
-
- /**
- * Abort the rebase operation and reset HEAD to the original branch
- *
- * @return bool
- */
- public function abort()
- {
- $builder = $this->git->getProcessBuilder()
- ->add('rebase')
- ->add('--abort');
-
- $this->git->run($builder->getProcess());
-
- return true;
- }
-
- /**
- * Restart the rebasing process by skipping the current patch
- *
- * @return bool
- */
- public function skip()
- {
- $builder = $this->git->getProcessBuilder()
- ->add('rebase')
- ->add('--skip');
-
- $this->git->run($builder->getProcess());
-
- return true;
- }
-
- /**
- * {@inheritdoc}
- *
- * - **onto** (_string_) Starting point at which to create the new commits
- * - **no-verify** (_boolean_) Bypasses the pre-rebase hook
- * - **force-rebase** (_boolean_) Force the rebase even if the current branch is a descendant of the commit you are rebasing onto
- */
- public function setDefaultOptions(OptionsResolverInterface $resolver)
- {
- $resolver->setDefaults(array(
- 'onto' => null,
- 'no-verify' => false,
- 'force-rebase' => false
- ));
-
- $resolver->setAllowedTypes(array(
- 'onto' => array('null', 'string')
- ));
- }
-
-} \ No newline at end of file