Skip to content

Commit

Permalink
Update git retrieve task
Browse files Browse the repository at this point in the history
Signed-off-by: rohitthakur2590 <[email protected]>
  • Loading branch information
rohitthakur2590 committed Jun 7, 2023
1 parent 59d06a8 commit 87e4aa0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/action/git_retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 87e4aa0

Please sign in to comment.