From f9b8b73b568afb6f8894ec0b52b9649a9dfc6c83 Mon Sep 17 00:00:00 2001 From: oanhnn Date: Wed, 1 Jun 2016 13:45:21 +0700 Subject: [PATCH] Fixed bug #675 The revison option is never checked in `deploy:update_code` --- recipe/common.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/recipe/common.php b/recipe/common.php index 6e0ba29b..3675c37b 100644 --- a/recipe/common.php +++ b/recipe/common.php @@ -177,17 +177,22 @@ task('deploy:update_code', function () { $gitCache = env('git_cache'); $depth = $gitCache ? '' : '--depth 1'; - if (input()->hasOption('tag')) { - $tag = input()->getOption('tag'); - } elseif (input()->hasOption('revision')) { - $revision = input()->getOption('revision'); + $at = ''; + if (!empty($branch)) { + $at = "-b $branch"; } - $at = ''; - if (!empty($tag)) { - $at = "-b $tag"; - } elseif (!empty($branch)) { - $at = "-b $branch"; + // If option `tag` is set + if (input()->hasOption('tag')) { + $tag = input()->getOption('tag'); + if (!empty($tag)) { + $at = "-b $tag"; + } + } + + // If option `tag` is not set and option `revision` is set + if (empty($tag) && input()->hasOption('revision')) { + $revision = input()->getOption('revision'); } $releases = env('releases_list');