From 87e4aa004b5f8e0f9764cc1c48a7981a774995ec Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Wed, 7 Jun 2023 11:19:54 +0530 Subject: [PATCH] Update git retrieve task Signed-off-by: rohitthakur2590 --- plugins/action/git_retrieve.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/action/git_retrieve.py b/plugins/action/git_retrieve.py index 5c46c6a4..21318bae 100644 --- a/plugins/action/git_retrieve.py +++ b/plugins/action/git_retrieve.py @@ -183,7 +183,7 @@ def _clone(self: T) -> None: import q q(tag) command_parts.extend( - ["clone", "--depth=1", "--progress", "--no-single-branch", origin, tag], + ["clone", "--depth=1", "--progress", "--branch", tag, origin], ) else: command_parts.extend( @@ -270,7 +270,11 @@ def _switch_checkout(self: T) -> None: if self._branch_exists: command_parts.extend(["switch", branch]) else: - command_parts.extend(["checkout", "-t", "-b", branch]) + tag = self._task.args["origin"].get("tag") + if tag: + command_parts.extend(["checkout", "-b", branch]) + else: + command_parts.extend(["checkout", "-t", "-b", branch]) command = Command( command_parts=command_parts,