diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-06-08 17:41:20 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-06-22 23:45:36 +0200 |
| commit | 0ec5cab132599cf644f0697c5f189366c1ebc773 (patch) | |
| tree | c3971f47bf91fca1bc132323f6e832fcc85b1f8a /tests/guix-git-authenticate.sh | |
| parent | 56eb949f3b4d10c1d8738eae96ac247b74bf20b9 (diff) | |
git authenticate: Gracefully handle passing an annotated tag to ‘--end’.
Partly fixes <https://issues.guix.gnu.org/74583>.
Previously, passing an annotated tag to ‘--end’, as can happen when
‘guix git authenticate’ is invoked by the pre-push hook when pushing
tags, would lead to an error:
guix git: error: Git error: the requested type does not match the type in the ODB
* guix/scripts/git/authenticate.scm (ensure-commit-id): New procedure.
(guix-git-authenticate): Use it.
* tests/guix-git-authenticate.sh: Test with $v1_2_0_annotated_tag.
Change-Id: I22e8eb665609522c80c1f0dcb9e77a46c23c0c3c
Diffstat (limited to 'tests/guix-git-authenticate.sh')
| -rw-r--r-- | tests/guix-git-authenticate.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/guix-git-authenticate.sh b/tests/guix-git-authenticate.sh index 7b8951b9aaf..6cbb7b59c1f 100644 --- a/tests/guix-git-authenticate.sh +++ b/tests/guix-git-authenticate.sh | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2020, 2022, 2024 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2020, 2022, 2024-2025 Ludovic Courtès <ludo@gnu.org> |
| 3 | # | 3 | # |
| 4 | # This file is part of GNU Guix. | 4 | # This file is part of GNU Guix. |
| 5 | # | 5 | # |
| @@ -53,6 +53,13 @@ guix git authenticate \ | |||
| 53 | --cache-key="$cache_key" --stats \ | 53 | --cache-key="$cache_key" --stats \ |
| 54 | --end="$v1_2_0_commit" | 54 | --end="$v1_2_0_commit" |
| 55 | 55 | ||
| 56 | # Likewise, but pass the OID of the annotated tag 'v1.2.0' instead of that of | ||
| 57 | # the commit--this mimics what the pre-push hook gets when pushing tags. | ||
| 58 | v1_2_0_annotated_tag="d5b556eef57321d0be89fdb07db447b2db2718ed" | ||
| 59 | guix git authenticate \ | ||
| 60 | --cache-key="$cache_key" --stats \ | ||
| 61 | --end="$v1_2_0_annotated_tag" | ||
| 62 | |||
| 56 | rm "$XDG_CACHE_HOME/guix/authentication/$cache_key" | 63 | rm "$XDG_CACHE_HOME/guix/authentication/$cache_key" |
| 57 | 64 | ||
| 58 | # Commit and signer of the 'v1.0.0' tag. | 65 | # Commit and signer of the 'v1.0.0' tag. |
