summaryrefslogtreecommitdiff
path: root/guix/git.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/git.scm')
-rw-r--r--guix/git.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/guix/git.scm b/guix/git.scm
index 56cebb06ed..f5593ab57c 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -198,12 +198,13 @@ Log progress and checkout info to LOG-PORT."
;;; Checkouts.
;;;
-;; Representation of the "latest" checkout of a branch.
+;; Representation of the "latest" checkout of a branch or a specific commit.
(define-record-type* <git-checkout>
git-checkout make-git-checkout
git-checkout?
(url git-checkout-url)
- (branch git-checkout-branch (default "master")))
+ (branch git-checkout-branch (default "master"))
+ (commit git-checkout-commit (default #f)))
(define latest-repository-commit*
(store-lift latest-repository-commit))
@@ -213,7 +214,9 @@ Log progress and checkout info to LOG-PORT."
;; "Compile" CHECKOUT by updating the local checkout and adding it to the
;; store.
(match checkout
- (($ <git-checkout> url branch)
+ (($ <git-checkout> url branch commit)
(latest-repository-commit* url
- #:ref `(branch . ,branch)
+ #:ref (if commit
+ `(commit . ,commit)
+ `(branch . ,branch))
#:log-port (current-error-port)))))