diff --git a/tekuti/git.scm b/tekuti/git.scm index 4bc7d60..3c9df31 100644 --- a/tekuti/git.scm +++ b/tekuti/git.scm @@ -167,7 +167,11 @@ "\n" 'suffix))))) (define (git-rev-parse rev) - (string-trim-both (git "rev-parse" rev))) + (or (false-if-exception + (let ((s (string-trim-both (call-with-input-file rev read-line)))) + (and (= (string-length s) 40) + s))) + (git "rev-parse" rev))) (define (git-rev-list rev n) (let lp ((lines (string-split