mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
git authenticate: Do nothing when invoked from the keyring branch.
Fixes <https://issues.guix.gnu.org/78283>. * guix/scripts/git/authenticate.scm (guix-git-authenticate): Call ‘current-branch’ and do nothing if it returns the keyring branch. Reported-by: Vagrant Cascadian <vagrant@debian.org> Change-Id: I66c2a3f4babf68ac1df0913db6bc708ac0c7968e
This commit is contained in:
parent
0ec5cab132
commit
99f85246e1
1 changed files with 29 additions and 20 deletions
|
@ -351,15 +351,24 @@ expected COMMIT and SIGNER~%")))
|
||||||
(file (call-with-input-file file
|
(file (call-with-input-file file
|
||||||
read-authorizations))))
|
read-authorizations))))
|
||||||
(cache-key (or (assoc-ref options 'cache-key)
|
(cache-key (or (assoc-ref options 'cache-key)
|
||||||
(repository-cache-key repository))))
|
(repository-cache-key repository)))
|
||||||
(define stats
|
(branch (current-branch repository)))
|
||||||
|
;; Since the keyring branch is not authenticated, exit successfully
|
||||||
|
;; when invoked on it. This exit status is what the 'post-merge' hook
|
||||||
|
;; expects when running 'git pull' on that branch, and what the
|
||||||
|
;; 'pre-push' hook expects when running 'git push' on that branch.
|
||||||
|
(if (and branch (string=? branch keyring))
|
||||||
|
(info (G_ "current branch '~a' is the keyring branch; \
|
||||||
|
doing nothing~%")
|
||||||
|
branch)
|
||||||
|
(let ((stats
|
||||||
(authenticate-repository repository (string->oid commit)
|
(authenticate-repository repository (string->oid commit)
|
||||||
(openpgp-fingerprint* signer)
|
(openpgp-fingerprint* signer)
|
||||||
#:end end
|
#:end end
|
||||||
#:keyring-reference keyring
|
#:keyring-reference keyring
|
||||||
#:historical-authorizations history
|
#:historical-authorizations history
|
||||||
#:cache-key cache-key
|
#:cache-key cache-key
|
||||||
#:make-reporter make-reporter))
|
#:make-reporter make-reporter)))
|
||||||
|
|
||||||
(if (configured? repository)
|
(if (configured? repository)
|
||||||
(maybe-upgrade-hooks repository)
|
(maybe-upgrade-hooks repository)
|
||||||
|
@ -373,4 +382,4 @@ expected COMMIT and SIGNER~%")))
|
||||||
(show-stats stats))
|
(show-stats stats))
|
||||||
|
|
||||||
(info (G_ "successfully authenticated commit ~a~%")
|
(info (G_ "successfully authenticated commit ~a~%")
|
||||||
(oid->string end))))))
|
(oid->string end))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue