diff options
author | Arun Isaac | 2022-04-05 14:31:39 +0530 |
---|---|---|
committer | Arun Isaac | 2022-04-05 14:31:39 +0530 |
commit | 57db90b5089fa94016f606236a85c99a1c93555c (patch) | |
tree | e582d06b559adb1be4e59b9473317f3af11dab89 | |
parent | 4bbaea54a4d549912aa773311cbda9fe659b9c0c (diff) | |
download | tissue-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-x | bin/tissue | 6 | ||||
-rw-r--r-- | tissue/git.scm | 9 |
2 files changed, 10 insertions, 5 deletions
@@ -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." |