diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-18 18:23:54 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-18 18:23:54 +0900 |
commit | 6d2035ee605980efa9915e10d35e7a355fc74077 (patch) | |
tree | 5d33f09a10185d66398070e26bcaf864f55709bd /builtin/pull.c | |
parent | Merge branch 'js/mingw-res-rebuild' (diff) | |
parent | pull: handle --verify-signatures for unborn branch (diff) | |
download | tgif-6d2035ee605980efa9915e10d35e7a355fc74077.tar.xz |
Merge branch 'jk/verify-sig-merge-into-void'
"git merge" and "git pull" that merges into an unborn branch used
to completely ignore "--verify-signatures", which has been
corrected.
* jk/verify-sig-merge-into-void:
pull: handle --verify-signatures for unborn branch
merge: handle --verify-signatures for unborn branch
merge: extract verify_merge_signature() helper
Diffstat (limited to 'builtin/pull.c')
-rw-r--r-- | builtin/pull.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin/pull.c b/builtin/pull.c index c21aa276f1..1b90622b13 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -557,6 +557,17 @@ static int run_fetch(const char *repo, const char **refspecs) static int pull_into_void(const struct object_id *merge_head, const struct object_id *curr_head) { + if (opt_verify_signatures) { + struct commit *commit; + + commit = lookup_commit(the_repository, merge_head); + if (!commit) + die(_("unable to access commit %s"), + oid_to_hex(merge_head)); + + verify_merge_signature(commit, opt_verbosity); + } + /* * Two-way merge: we treat the index as based on an empty tree, * and try to fast-forward to HEAD. This ensures we will not lose |