Skip to content

Commit 0cef8ac

Browse files
authored
feat: add --gpg-sign option on commits (ruby-git#518)
Add --gpg-sign option on commits Signed-off-by: othmane399 <othmane.elmassari@doctolib.com>
1 parent 765df7c commit 0cef8ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/git/lib.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ def remove(path = '.', opts = {})
646646
# :date
647647
# :no_verify
648648
# :allow_empty_message
649+
# :gpg_sign
649650
#
650651
# @param [String] message the commit message to be used
651652
# @param [Hash] opts the commit options to be used
@@ -659,6 +660,7 @@ def commit(message, opts = {})
659660
arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String
660661
arr_opts << '--no-verify' if opts[:no_verify]
661662
arr_opts << '--allow-empty-message' if opts[:allow_empty_message]
663+
arr_opts << '--gpg-sign' if opts[:gpg_sign] == true || "--gpg-sign=#{opts[:gpg_sign]}" if opts[:gpg_sign]
662664

663665
command('commit', arr_opts)
664666
end

0 commit comments

Comments
 (0)