From 9920e9e57a7c886ed1421902c09a196e9f52ca60 Mon Sep 17 00:00:00 2001 From: Tim Gunter Date: Thu, 15 May 2014 14:53:42 -0400 Subject: [PATCH 1/6] Add support for detached heads. --- src/PHPGit/Command/BranchCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PHPGit/Command/BranchCommand.php b/src/PHPGit/Command/BranchCommand.php index 4b42f50..353dc74 100644 --- a/src/PHPGit/Command/BranchCommand.php +++ b/src/PHPGit/Command/BranchCommand.php @@ -64,7 +64,10 @@ public function __invoke(array $options = array()) foreach ($lines as $line) { $branch = array(); - preg_match('/(?\*| ) (?[^\s]+) +((?:->) (?[^\s]+)|(?[0-9a-z]{7}) (?.*))/', $line, $matches); + preg_match('/(?<current>\*| ) (?<name>[^\s]+)?(?<nobranch>\([\s\w]+\))? +((?:->) (?<alias>[^\s]+)|(?<hash>[0-9a-z]{7}) (?<title>.*))/', $line, $matches); + if (key_exists('nobranch', $matches) && $matches['nobranch']) { + $matches['name'] = $matches['nobranch']; + } $branch['current'] = ($matches['current'] == '*'); $branch['name'] = $matches['name']; @@ -226,4 +229,4 @@ protected function getProcessBuilder() ->add('branch'); } -} \ No newline at end of file +} \ No newline at end of file From 515c758a545600cb77b931a03c4ac110402f9839 Mon Sep 17 00:00:00 2001 From: Tim Gunter <gunter.tim@gmail.com> Date: Wed, 23 May 2018 20:40:32 -0400 Subject: [PATCH 2/6] Fix symfony version requirements --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 167c24d..552b479 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "symfony/options-resolver": ">=2.3" }, "require-dev": { - "symfony/filesystem": ">=2.3" + "symfony/filesystem": "~2.0" }, "autoload": { "psr-0": { From 1f59ca2b830476a2f29f14dbc6a0e80e1482ec62 Mon Sep 17 00:00:00 2001 From: Tim Gunter <gunter.tim@gmail.com> Date: Wed, 23 May 2018 20:47:43 -0400 Subject: [PATCH 3/6] Re-fix version requirements --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 552b479..aa726c5 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ ], "require": { "php": ">=5.3.2", - "symfony/process":">=2.3", + "symfony/process":"~2.0", "symfony/options-resolver": ">=2.3" }, "require-dev": { - "symfony/filesystem": "~2.0" + "symfony/filesystem": ">=2.3" }, "autoload": { "psr-0": { From 2770eeef14c27997dc9588968548d4a76743abf5 Mon Sep 17 00:00:00 2001 From: Tim Gunter <gunter.tim@gmail.com> Date: Wed, 23 May 2018 21:44:48 -0400 Subject: [PATCH 4/6] Bring all component versions inline --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index aa726c5..264003f 100644 --- a/composer.json +++ b/composer.json @@ -12,10 +12,10 @@ "require": { "php": ">=5.3.2", "symfony/process":"~2.0", - "symfony/options-resolver": ">=2.3" + "symfony/options-resolver": "~2.0" }, "require-dev": { - "symfony/filesystem": ">=2.3" + "symfony/filesystem": "~2.0" }, "autoload": { "psr-0": { From 81a1946ed5d90d68e1dc143732a4e74724b3bbe0 Mon Sep 17 00:00:00 2001 From: Tim Gunter <gunter.tim@gmail.com> Date: Thu, 24 May 2018 10:24:26 -0400 Subject: [PATCH 5/6] Add getting for repo dir --- src/PHPGit/Git.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/PHPGit/Git.php b/src/PHPGit/Git.php index f952d6f..a648fd0 100644 --- a/src/PHPGit/Git.php +++ b/src/PHPGit/Git.php @@ -260,6 +260,16 @@ public function setRepository($directory) return $this; } + /** + * Gets the Git repository path + * + * @return string + */ + public function getRepository() + { + return $this->directory; + } + /** * Returns version number * From 6d2108f7891f649e90e62cfb6d26a6fb5bd62b03 Mon Sep 17 00:00:00 2001 From: Tim Gunter <gunter.tim@gmail.com> Date: Thu, 24 May 2018 10:25:40 -0400 Subject: [PATCH 6/6] Remove branch alias --- composer.json | 5 ----- src/PHPGit/Git.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 264003f..3469e23 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,5 @@ "psr-0": { "": "src" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } } } \ No newline at end of file diff --git a/src/PHPGit/Git.php b/src/PHPGit/Git.php index a648fd0..b2d3ff2 100644 --- a/src/PHPGit/Git.php +++ b/src/PHPGit/Git.php @@ -262,7 +262,7 @@ public function setRepository($directory) /** * Gets the Git repository path - * + * * @return string */ public function getRepository()