Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the gpg_sign commit option #525

Merged
merged 1 commit into from Jul 7, 2021
Merged

Fix the gpg_sign commit option #525

merged 1 commit into from Jul 7, 2021

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Jul 6, 2021

Signed-off-by: James Couball jcouball@yahoo.com

Your checklist for this pull request

馃毃Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

When support for the gpg_sign option was added to the Git::Lib#commit in #518, it did not actually work properly for the case of the key being passed into the commit command.

This PR does the following:

  • Correctly allows specification of a GPG Key in the gpg-sign option as follows:
key_id = '0A46826A'
g.commit('message', gpg_sign: key_id)
  • Add tests to make sure the commit command line is built correctly for the two use cases of gpg_sign.
  • Add examples in the README.md

This fix also fixes the warning introduced in #518 the was output by Ruby when requiring the git gem:

$ irb
3.0.1 :001 > require 'git'
/Users/couballj/.rvm/gems/ruby-3.0.1/gems/git-1.9.0/lib/git/lib.rb:663: warning: string literal in condition
 => true
3.0.1 :002 >

Signed-off-by: James Couball <jcouball@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant