aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-02-28 14:15:53 +0530
committerArun Isaac2022-02-28 18:10:05 +0530
commit74febb7121d5e54cd388ab4e8176c8774ffcd438 (patch)
treeb1327a7de10e9e554fa178e20bb6cc73e55f2e01
parent8b900587e7e4334170191aec22b117034f4c39ed (diff)
downloadguix-forge-74febb7121d5e54cd388ab4e8176c8774ffcd438.tar.gz
guix-forge-74febb7121d5e54cd388ab4e8176c8774ffcd438.tar.lz
guix-forge-74febb7121d5e54cd388ab4e8176c8774ffcd438.zip
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)[<forge-project>]: Document that the repository-branch field is unused.
-rw-r--r--doc/forge.skb3
-rw-r--r--forge/build/git.scm12
-rw-r--r--forge/forge.scm1
3 files changed, 11 insertions, 5 deletions
diff --git a/doc/forge.skb b/doc/forge.skb
index 59640a6..aaf74f3 100644
--- a/doc/forge.skb
+++ b/doc/forge.skb
@@ -98,7 +98,8 @@ specified ,a cron job triggers the CI jobs once a day.]))]
:default [,(code ['post-receive-hook]) for local repositories
and ,(code ['cron]) for remote repositories])
(record-field "repository-branch"
- [Main branch of the repository]))
+ [Main branch of the repository. This field is currently
+unused unused, and may be deprecated in the future.]))
(record-documentation "forge/laminar.scm" '<forge-laminar-job>
(record-field "name"
[Name of the job])
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")
diff --git a/forge/forge.scm b/forge/forge.scm
index 5814593..5c61d4c 100644
--- a/forge/forge.scm
+++ b/forge/forge.scm
@@ -210,7 +210,6 @@ file name or URI designating the Guix daemon endpoint."
#$(string-append (forge-project-name project)
"-checkout")
#$(forge-project-repository project)
- #$(forge-project-repository-branch project)
#:show-commit? #t))
(drv (gexp->derivation #$(string-append
(forge-laminar-job-name job)