about summary refs log tree commit diff
path: root/web/view/markdown.scm
diff options
context:
space:
mode:
Diffstat (limited to 'web/view/markdown.scm')
-rw-r--r--web/view/markdown.scm19
1 files changed, 9 insertions, 10 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm
index 59eb8b8..e6d595d 100644
--- a/web/view/markdown.scm
+++ b/web/view/markdown.scm
@@ -56,15 +56,15 @@
           (br)
           (br))))
 
-(define (fetch-file repo query_path)
-  (let* ( (abs_path (string-append repo "/" query_path)))
-    (if (file-exists? abs_path)  (let* ((full_path (canonicalize-path abs_path))
-                                        (content (call-with-input-file full_path get-string-all))
+(define (fetch-file repo query-path)
+  (let* ( (abs-path (string-append repo "/" query-path)))
+    (if (file-exists? abs-path)  (let* ((full-path (canonicalize-path abs-path))
+                                        (content (call-with-input-file full-path get-string-all))
                                         (commit-sha (get-latest-commit-sha1 repo)))
-                                   `(("file_path" . ,query_path)
+                                   `(("file_path" . ,query-path)
                                      ("content" . ,content)
                                      ("hash" . ,commit-sha))
-                                   ) (throw 'file-error  (string-append "the file path " abs_path " does not exists")))))
+                                   ) (throw 'file-error  (string-append "the file path " abs-path " does not exists")))))
 
 (define (git-invoke repo-path . args)
   (apply system* "git" "-C" repo-path args))
@@ -80,10 +80,9 @@
     commit-sha))
 
 (define* (commit-file repo file-path content commit-message username email #:optional (prev-commit ""))
-  (if (string=? prev-commit (get-latest-commit-sha1 repo))
-      #t
-      (throw 'system-error (format #f "Commits do no match.Please pull in latest  changes for current * ~a * and prev * ~a * "
-                                   (get-latest-commit-sha1 repo) prev-commit)))
+  (unless (string=? prev-commit (get-latest-commit-sha1 repo))
+    (throw 'system-error (format #f "Commits do no match.Please pull in latest  changes for current * ~a * and prev * ~a * "
+                                 (get-latest-commit-sha1 repo) prev-commit)))
   (if (is-repo? repo)
       (match (file-exists? (string-append repo "/" file-path))
         (#t