Closed mikkoi closed 2 years ago
We could also leave the unit test out of the bug fix and only include the other commits?
This case is still open. I get tired of using CheckCommit=0
when I commit. :grin:
Hi Mikko. I'm sorry for the delay...
Thanks again for spotting yet another bug!
I understood the problem and I'm going to incorporate your solution. I'm going to cherry-pick your commits instead of merging the whole PR because it does more than one thing, OK?
I'm going to cherry-pick your commits instead of merging the whole PR because it does more than one thing, OK?
No problem. That pull request is a bit of a monster, especially with the big test file.
I just pushed a few commits to the next
branch. They implement all of yours but the one adding test cases. I'm going to review it later.
Note that commit 91948b35 re-implements your fix using the Git::Repository::Plugin::GitHooks::get_commit routine, as it's already capable of converting a revision string into a Git::Repository::Log object. Also, I noticed that there was another place needing that fix.
What do you think?
It is better to pass objects than revision hash strings.
Good!
The earlier PR https://github.com/gnustavo/Git-Hooks/pull/69 introduced a new problem because the
check_post_commit()
subroutine was passing the commit parameter as a hash. To fix both problems, I reverted the earlier fix and changed now both subroutinescheck_post_commit()
andsignature_errors()
.I also created a test. It is unfortunately somewhat complicated and prone to break as it depends on a peculiarity of
gpg
program, possibly a bug. I tested with an earlier version ofgpg
and I could not run the test successfully. But with gpg version 2.2.27 the tests work. If the local version ofgpg
is not suitable, the tests will skip that part and the test suite will not fail. It tests signature in both post-commit (client) and update (server) hooks.