mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-26 20:49:29 -05:00
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.
This commit is contained in:
parent
611ae310f4
commit
cde3a69a37
1 changed files with 6 additions and 2 deletions
|
@ -309,8 +309,12 @@ (define (reference-available? repository ref)
|
|||
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)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue