Skip to content

Commit

Permalink
Fix git branch checkout operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ferki committed Jan 21, 2025
1 parent cebfb4d commit 208515b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Revision history for Rex
[API CHANGES]

[BUG FIXES]
- Fix git branch checkout operations

[DOCUMENTATION]

Expand Down
3 changes: 3 additions & 0 deletions lib/Rex/SCM/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ sub checkout {
( my $default_origin_branch = $head_ref ) =~ s{refs/remotes/origin/}{}msx;

my $branch = $checkout_opt->{"branch"} || $default_origin_branch;

i_run "git checkout -B $branch", cwd => $checkout_to, %run_opt;

Rex::Logger::info( "Pulling "
. $repo_info->{"url"} . " to "
. ( $checkout_to ? $checkout_to : "." ) );
Expand Down

0 comments on commit 208515b

Please sign in to comment.