Skip to content

Commit 9f737eb

Browse files
committed
Fix bug in Git::Lib#commit_tree when multiple parents are passed in
1 parent 8a1b260 commit 9f737eb

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
@@ -1031,7 +1031,7 @@ def commit_tree(tree, opts = {})
10311031
arr_opts = []
10321032
arr_opts << tree
10331033
arr_opts << '-p' << opts[:parent] if opts[:parent]
1034-
arr_opts += [opts[:parents]].map { |p| ['-p', p] }.flatten if opts[:parents]
1034+
arr_opts += Array(opts[:parents]).map { |p| ['-p', p] }.flatten if opts[:parents]
10351035
command('commit-tree', *arr_opts, redirect: "< #{escape t.path}")
10361036
end
10371037

@@ -1101,7 +1101,7 @@ def current_command_version
11011101
# @example
11021102
# lib.current_command_version #=> [2, 42, 0]
11031103
#
1104-
# lib.compare_version_to(2, 41, 0) #=> 1
1104+
# lib.compare_version_to(2, 41, 0) #=> 1
11051105
# lib.compare_version_to(2, 42, 0) #=> 0
11061106
# lib.compare_version_to(2, 43, 0) #=> -1
11071107
#

0 commit comments

Comments
 (0)