Skip to content

Fix Git::Lib#commit_data for GPG-signed commits #610

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 2, 2023
Merged
Prev Previous commit
Next Next commit
Remove unnecessary default tag/commit message values
These methods always explicitly set the 'message' key of the output hash
based on the `git cat-file` output, so we don't need a default in the
starting hash.

Signed-off-by: Simon Coffey <simon.coffey@futurelearn.com>
  • Loading branch information
Simon Coffey committed Jan 17, 2023
commit 2952cedea8ed539f9d0cf35c460b9a2f4e4b9f26
10 changes: 3 additions & 7 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ def commit_data(sha)

def process_commit_data(data, sha = nil, indent = 4)
hsh = {
'sha' => sha,
'message' => '',
'parent' => []
'sha' => sha,
'parent' => []
}

each_cat_file_header(data) do |key, value|
Expand Down Expand Up @@ -266,10 +265,7 @@ def tag_data(name)
end

def process_tag_data(data, name, indent=4)
hsh = {
'name' => name,
'message' => ''
}
hsh = { 'name' => name }

each_cat_file_header(data) do |key, value|
hsh[key] = value
Expand Down