- (with-current-working-directory
- (list git-base-dir repo)
- (lambda ()
- (let-values (((in-port out-port id) (process "git" args)))
- (let ((result (read-lines in-port)))
- (close-input-port in-port)
- (close-output-port out-port)
- result)))))
+ (let ((repo-pathname (make-pathname git-base-dir repo)))
+ (if (not (string-prefix? git-base-dir (normalize-pathname repo-pathname)))
+ (error "Invalid git repository."))
+ (with-current-working-directory
+ repo-pathname
+ (lambda ()
+ (let-values (((in-port out-port id) (process "git" args)))
+ (let ((result (read-lines in-port)))
+ (close-input-port in-port)
+ (close-output-port out-port)
+ result))))))