From 480c050275340d7e2f555f16063a0bd221acdcf8 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 30 May 2021 01:16:48 -0700 Subject: [PATCH] Check that a revision has been provided before trying to parse it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting up Tekuti for the first time the ‘compute-bogus-comments’ will get the current commit passed in and try to get the parent. Since there is only the “initial commit” at this stage it will get ‘#f’ as the parent commit and pass it in to ‘fold-commits’. Trying to parse revision ‘#f’ will surely fail. The ‘fold-commits’ function already expects that ‘rev’ might be empty, so this should work out fine. --- tekuti/git.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tekuti/git.scm b/tekuti/git.scm index cad4e0c..a3d597d 100644 --- a/tekuti/git.scm +++ b/tekuti/git.scm @@ -334,7 +334,7 @@ (cons (string->symbol k) v)))))) (define (fold-commits f rev seed) - (let lp ((rev (git-rev-parse rev)) (seed seed)) + (let lp ((rev (and rev (git-rev-parse rev))) (seed seed)) (if rev (let ((commit (parse-commit rev))) (lp (assq-ref commit 'parent)