Skip to content

Commit 1b86e11

Browse files
Fixing :new_branch usage on checkout
1 parent e36a41b commit 1b86e11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/git/lib.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ def branch_delete(branch)
583583

584584
def checkout(branch, opts = {})
585585
arr_opts = []
586-
arr_opts << '-f' if opts[:force]
587-
arr_opts << '-b' << opts[:new_branch] if opts[:new_branch]
586+
arr_opts << '-b' if opts[:new_branch] || opts[:b]
587+
arr_opts << '--force' if opts[:force] || opts[:f]
588588
arr_opts << branch
589589

590590
command('checkout', arr_opts)

0 commit comments

Comments
 (0)