summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-23 18:05:25 +0530
committerArun Isaac2022-06-23 19:06:34 +0530
commitbddf05502aadd0936a3211a710bb09f564222b3e (patch)
tree78717f8a7d4fb7dad4adf8504ca674bffc702d88
parentd9f0e99ce3a2d1c7fd8c7db5e0ee509e5aff900f (diff)
downloadtissue-bddf05502aadd0936a3211a710bb09f564222b3e.tar.gz
tissue-bddf05502aadd0936a3211a710bb09f564222b3e.tar.lz
tissue-bddf05502aadd0936a3211a710bb09f564222b3e.zip
git: Add current-git-repository utility function.
* tissue/git.scm (current-git-repository): New public function.
-rw-r--r--tissue/git.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/tissue/git.scm b/tissue/git.scm
index 5cc8a52..84dd1ec 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -38,6 +38,7 @@
#:use-module ((bytestructures guile) #:prefix bs:)
#:use-module (tissue utils)
#:export (git-top-level
+ current-git-repository
git-tracked-files))
;; We bind additional functions from libgit2 that are not already
@@ -170,6 +171,10 @@ repository."
(else
(loop (dirname curdir))))))
+(define (current-git-repository)
+ "Return the current git repository."
+ (repository-open (git-top-level)))
+
(define (git-tracked-files)
"Return a list of all files tracked in the current git repository. The
returned filenames are relative to the top-level directory of the