aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-20 21:44:23 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-20 21:44:23 +0000
commit6d1428f350d8e21c58f3cdecd6964c5ce8af70e5 (patch)
treea58e1dccf306cc17b07b7429e5cdca654bef5c56
parent959d4c9c8e02e1241de80e844ef5ca36e66aab27 (diff)
downloadqa-frontpage-6d1428f350d8e21c58f3cdecd6964c5ce8af70e5.tar
qa-frontpage-6d1428f350d8e21c58f3cdecd6964c5ce8af70e5.tar.gz
Tweak changing directory
-rw-r--r--guix-qa-frontpage/git-repository.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/guix-qa-frontpage/git-repository.scm b/guix-qa-frontpage/git-repository.scm
index 5ae2d56..6a6297c 100644
--- a/guix-qa-frontpage/git-repository.scm
+++ b/guix-qa-frontpage/git-repository.scm
@@ -21,6 +21,11 @@
get-git-branch-head-committer-date))
+(define* (guix.git-excursion thunk #:optional (dir "guix.git"))
+ (monitor
+ (with-directory-excursion dir
+ (thunk))))
+
(define (ensure-repository-exists!)
(monitor
(unless (file-exists? "guix.git")
@@ -29,12 +34,13 @@
"https://git.savannah.gnu.org/git/guix.git"
"guix.git")
- (with-directory-excursion "guix.git"
- (invoke "git" "remote" "add" "patches"
- "git@git.guix-patches.cbaines.net:guix-patches")
+ (guix.git-excursion
+ (lambda ()
+ (invoke "git" "remote" "add" "patches"
+ "git@git.guix-patches.cbaines.net:guix-patches")
- (invoke "git" "config" "user.name" "Guix Patches Tester")
- (invoke "git" "config" "user.email" "")))))
+ (invoke "git" "config" "user.name" "Guix Patches Tester")
+ (invoke "git" "config" "user.email" ""))))))
(define (update-repository!)
(with-bare-git-repository
@@ -45,9 +51,7 @@
(define (with-bare-git-repository thunk)
(ensure-repository-exists!)
- (monitor
- (with-directory-excursion "guix.git"
- (thunk))))
+ (guix.git-excursion thunk))
(define* (with-git-worktree name commit thunk
#:key remove-after?)
@@ -58,8 +62,7 @@
"-b" name
commit)))
- (with-directory-excursion name
- (thunk))
+ (guix.git-excursion thunk name)
(when remove-after?
(with-bare-git-repository