git: 'reference-available?' handles short commit IDs.
Reported by Simon Tournier on #guix. Until now 'reference-available?' would always return #f when passed a short commit ID. * guix/git.scm (reference-available?): Call 'object-lookup-prefix' when COMMIT is shorter than 40 characters.master
parent
611ae310f4
commit
cde3a69a37
|
@ -309,8 +309,12 @@ dynamic extent of EXP."
|
|||
definitely available in REPOSITORY, false otherwise."
|
||||
(match ref
|
||||
(('commit . commit)
|
||||
(false-if-git-not-found
|
||||
(->bool (commit-lookup repository (string->oid commit)))))
|
||||
(let ((len (string-length commit))
|
||||
(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))))))
|
||||
(_
|
||||
#f)))
|
||||
|
||||
|
|
Reference in New Issue