aboutsummaryrefslogtreecommitdiff
path: root/guix/inferior.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-10-11 10:42:43 +0200
committerLudovic Courtès <ludo@gnu.org>2022-10-11 16:05:31 +0200
commit602527ab9778165ca9a8f9cb62036038b5354688 (patch)
treeb4d2b261cbcc1e78c4893f80a50959373496aecc /guix/inferior.scm
parent7d9fd1d7b7a328555adda4f72d7eec8906f28880 (diff)
downloadguix-602527ab9778165ca9a8f9cb62036038b5354688.tar
guix-602527ab9778165ca9a8f9cb62036038b5354688.tar.gz
git: Factorize 'commit-id?' predicate.
* guix/git.scm (commit-id?): New procedure, copied from (guix swh). (resolve-reference): Use it instead of inline code. * guix/inferior.scm (channel-full-commit): Likewise.
Diffstat (limited to 'guix/inferior.scm')
-rw-r--r--guix/inferior.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 20a86bbfda..cbb3c0a36e 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -40,7 +40,7 @@
#:use-module (guix search-paths)
#:use-module (guix profiles)
#:use-module (guix channels)
- #:use-module ((guix git) #:select (update-cached-checkout))
+ #:use-module ((guix git) #:select (update-cached-checkout commit-id?))
#:use-module (guix monads)
#:use-module (guix store)
#:use-module (guix derivations)
@@ -833,7 +833,7 @@ CHANNEL's 'commit' field is a full SHA1, return it as-is; if it's a SHA1
prefix, resolve it; and if 'commit' is unset, fetch CHANNEL's branch tip."
(let ((commit (channel-commit channel))
(branch (channel-branch channel)))
- (if (and commit (= (string-length commit) 40))
+ (if (and commit (commit-id? commit))
commit
(let* ((ref (if commit `(commit . ,commit) `(branch . ,branch)))
(cache commit relation