Skip to content

Commit 36fb3cd

Browse files
kokeschacon
authored andcommitted
Add :author option to commit
Signed-off-by: Scott Chacon <[email protected]>
1 parent 93ea661 commit 36fb3cd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/git/base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def reset_hard(commitish = nil, opts = {})
256256
# options:
257257
# :add_all
258258
# :allow_empty
259+
# :author
259260
def commit(message, opts = {})
260261
self.lib.commit(message, opts)
261262
end

lib/git/lib.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ def commit(message, opts = {})
372372
arr_opts = ["-m '#{message}'"]
373373
arr_opts << '-a' if opts[:add_all]
374374
arr_opts << '--allow-empty' if opts[:allow_empty]
375+
arr_opts << "--author '#{opts[:author]}'" if opts[:author]
375376
command('commit', arr_opts)
376377
end
377378

0 commit comments

Comments
 (0)