summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-04 16:51:38 +0530
committerArun Isaac2022-07-04 17:28:26 +0530
commite26fbe669425090cc294aa873a85d1f30e84caca (patch)
treeabb39b1f9e88acc3a5d97f3e9d41ff326291ad82
parentb6f24d5222c502e5deb0c9d17eef8255e232e924 (diff)
downloadtissue-e26fbe669425090cc294aa873a85d1f30e84caca.tar.gz
tissue-e26fbe669425090cc294aa873a85d1f30e84caca.tar.lz
tissue-e26fbe669425090cc294aa873a85d1f30e84caca.zip
git: Add %current-git-repository parameter.
* tissue/git.scm (%current-git-repository): New public parameter. (current-git-repository): Use %current-git-repository.
-rw-r--r--tissue/git.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/tissue/git.scm b/tissue/git.scm
index 3fc8df1..9a95352 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -31,6 +31,7 @@
#:use-module (bytestructures guile)
#:use-module (tissue utils)
#:export (git-top-level
+ %current-git-repository
current-git-repository
commit-date
git-tracked-files
@@ -47,9 +48,15 @@
(proc (diff->pointer diff) %null-pointer)
diff)))
+(define %current-git-repository
+ (make-parameter #f))
+
(define (current-git-repository)
- "Return the current git repository."
- (repository-open-ext (getcwd) (list)))
+ "Return the current git repository, either the repository specified by
+the %current-git-repository parameter or the repository at the current
+directory."
+ (or (%current-git-repository)
+ (repository-open-ext (getcwd) (list))))
(define (git-top-level)
"Return the top-level directory of the current git repository."