summaryrefslogtreecommitdiff
path: root/tissue/document.scm
diff options
context:
space:
mode:
authorArun Isaac2022-07-03 01:44:50 +0530
committerArun Isaac2022-07-03 23:21:41 +0530
commit2562403d13daaabb1c6eb324b2c34b0c17e1656b (patch)
treec22f4ee45909f416f90d62ee3b3ab7501bb19d00 /tissue/document.scm
parent7db5c16efe41ed0e57be24125f21edf94e78429e (diff)
downloadtissue-2562403d13daaabb1c6eb324b2c34b0c17e1656b.tar.gz
tissue-2562403d13daaabb1c6eb324b2c34b0c17e1656b.tar.lz
tissue-2562403d13daaabb1c6eb324b2c34b0c17e1656b.zip
tissue: Read files from git repository, not from the working tree.
This also frees us from checking if the file actually exists in the working tree. * bin/tissue (tissue-show): Use call-with-file-in-git instead of call-with-input-file. (load-config): Use call-with-file-in-git and eval-string instead of load. * tissue/document.scm: Import (tissue git). (document-text, read-gemtext-document): Use call-with-file-in-git instead of call-with-input-file. * tissue/issue.scm (file-details): Read from a port instead of from a file. (read-gemtext-issue): Call file-details with a port reading the file committed into the git repository. * tissue/web/server.scm: Import (tissue git). * tissue/web/static.scm (exporter): Use call-with-file-in-git instead of call-with-input-file.
Diffstat (limited to 'tissue/document.scm')
-rw-r--r--tissue/document.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/tissue/document.scm b/tissue/document.scm
index 1ee55cf..e46e055 100644
--- a/tissue/document.scm
+++ b/tissue/document.scm
@@ -28,6 +28,7 @@
#:use-module (oop goops)
#:use-module (term ansi-color)
#:use-module (xapian xapian)
+ #:use-module (tissue git)
#:use-module (tissue utils)
#:export (slot-set
object->scm
@@ -163,7 +164,7 @@ and further text, increase-termpos! must be called before indexing."
(define-method (document-text (document <file-document>))
"Return the full text of DOCUMENT."
- (call-with-input-file (file-document-path document)
+ (call-with-file-in-git (current-git-repository) (file-document-path document)
get-string-all))
(define-method (document-term-generator (document <file-document>))
@@ -255,7 +256,7 @@ a list of search results."
(define (read-gemtext-document file)
"Reade gemtext document from FILE. Return a <file-document> object."
(make <file-document>
- #:title (or (call-with-input-file file
+ #:title (or (call-with-file-in-git (current-git-repository) file
(lambda (port)
(port-transduce (tfilter-map (lambda (line)
;; The first level one