1
0
Fork 0

Check that a revision has been provided before trying to parse it

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.
This commit is contained in:
Tom Willemse 2021-05-30 01:16:48 -07:00
parent ae3d83d5f2
commit 480c050275

View file

@ -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)