diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-03-21 23:39:43 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-03-21 23:39:43 -0400 |
commit | a9429c8f2207841c649438187d6e19046d323a16 (patch) | |
tree | a06e4b8a87b6a42742cf6750276746a10b6c2139 /guix/git-authenticate.scm | |
parent | f0136b36ae8c1e9c174043bd50e0e24413c0f345 (diff) | |
parent | 49b350fafc2c3ea1db66461b73d4e304cd13ec92 (diff) |
Merge branch 'staging' into core-updates.
Diffstat (limited to 'guix/git-authenticate.scm')
-rw-r--r-- | guix/git-authenticate.scm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm index ab3fcd8b2f..419cb85afc 100644 --- a/guix/git-authenticate.scm +++ b/guix/git-authenticate.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2019, 2020, 2021, 2022 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +22,9 @@ #:use-module (guix base16) #:autoload (guix base64) (base64-encode) #:use-module ((guix git) - #:select (commit-difference false-if-git-not-found)) + #:select (commit-difference + commit-descendant? + false-if-git-not-found)) #:use-module (guix i18n) #:use-module ((guix diagnostics) #:select (formatted-message)) #:use-module (guix openpgp) @@ -426,6 +428,17 @@ denoting the authorized keys for commits whose parent lack the (verify-introductory-commit repository keyring start-commit signer)) + ;; Make sure END-COMMIT is a descendant of START-COMMIT or of one of + ;; AUTHENTICATED-COMMITS, which are known to be descendants of + ;; START-COMMIT. + (unless (commit-descendant? end-commit + (cons start-commit + authenticated-commits)) + (raise (formatted-message + (G_ "commit ~a is not a descendant of introductory commit ~a") + (oid->string (commit-id end-commit)) + (oid->string (commit-id start-commit))))) + (let ((stats (call-with-progress-reporter reporter (lambda (report) (authenticate-commits repository commits |