summary refs log tree commit diff
path: root/build-aux
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-05-07 11:52:23 +0200
committerLudovic Courtès <ludo@gnu.org>2020-05-07 12:55:14 +0200
commit8d65a71e5fb21303df8628f89e84d2684738f145 (patch)
treea6bfa824dbd5b3b52527d925647fe47c5e4b6ed5 /build-aux
parentf45baa4a0a9d7897223ae14faee7083cb19df61e (diff)
downloadguix-8d65a71e5fb21303df8628f89e84d2684738f145.tar.gz
git-authenticate: Use the 'origin/keyring' branch by default.
Previously one would need to have a worktree for the local 'keyring'
branch.

Reported by reepca and bricewge on #guix.

* build-aux/git-authenticate.scm (load-keyring-from-reference): Use
'branch-lookup' instead of 'reference-lookup'.  Add "origin/" to
REFERENCE.
(authenticate-commits): Have #:keyring-reference default to "keyring".
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/git-authenticate.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/build-aux/git-authenticate.scm b/build-aux/git-authenticate.scm
index 7bb3af6ecb..ab50459369 100644
--- a/build-aux/git-authenticate.scm
+++ b/build-aux/git-authenticate.scm
@@ -337,7 +337,9 @@ may not be ASCII-armored."
 (define (load-keyring-from-reference repository reference)
   "Load the '.key' files from the tree at REFERENCE in REPOSITORY and return
 an OpenPGP keyring."
-  (let* ((reference (reference-lookup repository reference))
+  (let* ((reference (branch-lookup repository
+                                   (string-append "origin/" reference)
+                                   BRANCH-REMOTE))
          (target    (reference-target reference))
          (commit    (commit-lookup repository target))
          (tree      (commit-tree commit)))
@@ -353,7 +355,7 @@ an OpenPGP keyring."
 
 (define* (authenticate-commits repository commits
                                #:key
-                               (keyring-reference "refs/heads/keyring")
+                               (keyring-reference "keyring")
                                (report-progress (const #t)))
   "Authenticate COMMITS, a list of commit objects, calling REPORT-PROGRESS for
 each of them.  Return an alist showing the number of occurrences of each key.