faster git-rev-parse
* tekuti/git.scm (git-rev-parse): Try to read the ref ourselves, first. Fall back to using git if that doesn't work (for example, if it's a packed ref).
This commit is contained in:
parent
8034123827
commit
085b4c76ef
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue