From 74febb7121d5e54cd388ab4e8176c8774ffcd438 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 28 Feb 2022 14:15:53 +0530 Subject: forge: Clone the default branch, not any specific branch. * forge/build/git.scm (download-git-to-store): Demote branch to optional keyword argument. * forge/forge.scm (derivation-job-gexp): Do not pass the branch argument to download-git-to-store. * doc/forge.skb (Reference)[]: Document that the repository-branch field is unused. --- forge/build/git.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'forge/build') diff --git a/forge/build/git.scm b/forge/build/git.scm index 428589e..5978a3e 100644 --- a/forge/build/git.scm +++ b/forge/build/git.scm @@ -40,9 +40,10 @@ (newline) (force-output)) -(define* (download-git-to-store store name url branch #:key show-commit?) +(define* (download-git-to-store store name url #:key branch show-commit?) "Download BRANCH of git repository from URL to STORE under NAME and -return store path. git and certificates should be in the environment." +return store path. If BRANCH is not specified, the default branch is +downloaded. git and certificates should be in the environment." (call-with-temporary-directory (lambda (directory) (with-directory-excursion directory @@ -53,7 +54,12 @@ return store path. git and certificates should be in the environment." (invoke-error-arguments condition) (invoke-error-exit-status condition)) (exit #f))) - (invoke "git" "clone" "--quiet" "--depth" "1" "--branch" branch url ".")) + (apply invoke + "git" "clone" "--quiet" "--depth" "1" url + (append (if branch + (list "--branch" branch) + (list)) + (list ".")))) (when show-commit? (hline) (invoke "git" "--no-pager" "log") -- cgit v1.2.3