summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-04-05 14:31:39 +0530
committerArun Isaac2022-04-05 14:31:39 +0530
commit57db90b5089fa94016f606236a85c99a1c93555c (patch)
treee582d06b559adb1be4e59b9473317f3af11dab89
parent4bbaea54a4d549912aa773311cbda9fe659b9c0c (diff)
downloadtissue-57db90b5089fa94016f606236a85c99a1c93555c.tar.gz
tissue-57db90b5089fa94016f606236a85c99a1c93555c.tar.lz
tissue-57db90b5089fa94016f606236a85c99a1c93555c.zip
git: Abstract out git-top-level.
* tissue/git.scm (git-top-level): New function. * bin/tissue: Import (tissue git). (load-config): Use git-top-level.
-rwxr-xr-xbin/tissue6
-rw-r--r--tissue/git.scm9
2 files changed, 10 insertions, 5 deletions
diff --git a/bin/tissue b/bin/tissue
index a1b4d88..2d05ba9 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -30,6 +30,7 @@
(ice-9 popen)
(ice-9 regex)
(tissue conditions)
+ (tissue git)
(tissue issue)
(tissue tissue)
(tissue utils)
@@ -353,10 +354,7 @@ Show the text of issue #ISSUE-NUMBER.
(memoize-thunk
(lambda ()
"Load configuration and return <tissue-configuration> object."
- (load (string-append (call-with-input-pipe
- get-line
- "git" "rev-parse" "--show-toplevel")
- "/tissue.scm")))))
+ (load (string-append (git-top-level) "/tissue.scm")))))
(define tissue-web
(match-lambda*
diff --git a/tissue/git.scm b/tissue/git.scm
index bd9798d..50da06b 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -21,7 +21,14 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-171)
#:use-module (tissue utils)
- #:export (git-tracked-files))
+ #:export (git-top-level
+ git-tracked-files))
+
+(define (git-top-level)
+ "Return the top-level directory of the current git repository."
+ (call-with-input-pipe
+ get-line
+ "git" "rev-parse" "--show-toplevel"))
(define (git-tracked-files)
"Return a list of all files tracked in the current git repository."