summaryrefslogtreecommitdiff
path: root/guix/git.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-10-05 17:09:53 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-10-05 17:09:53 -0400
commitd3a0869e9b667d563e7e877c93f30a70896c5831 (patch)
tree15460b434f44cf76916947ed2afbe848c43311d2 /guix/git.scm
parent70b0f2b9134b2db286f707835394798de039c277 (diff)
parent5694352c05ed4fdb57a9843d8f023ca3d85992c3 (diff)
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix/git.scm')
-rw-r--r--guix/git.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/guix/git.scm b/guix/git.scm
index 1cb87a4560..a8f5144299 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2023 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -366,15 +367,16 @@ definitely available in REPOSITORY, false otherwise."
;; reference should not be considered available, as it could have changed on
;; the remote.
(match ref
- ((or ('commit . commit)
- ('tag-or-commit . (? commit-id? commit)))
- (let ((len (string-length commit))
- (oid (string->oid commit)))
+ (('commit . (? commit-id? commit))
+ (let ((oid (string->oid commit)))
(false-if-git-not-found
- (->bool (if (< len 40)
- (object-lookup-prefix repository oid len OBJ-COMMIT)
- (commit-lookup repository oid))))))
+ (->bool (commit-lookup repository oid)))))
+ ((or ('tag . str)
+ ('tag-or-commit . str))
+ (false-if-git-not-found
+ (->bool (resolve-reference repository ref))))
(_
+ ;; For the others REF as branch or symref, the REF cannot be available
#f)))
(define (clone-from-swh url tag-or-commit output)