Refix git-hash-object in the saftest way

parent ac943fb8
......@@ -169,9 +169,12 @@
;; string -> file-id
(define* (git-hash-object content #:optional (type 'blob))
(let ((cmdline (format #f "echo -n '~a' | git hash-object -t ~a -w --stdin"
content type)))
(one-line-result ,cmdline)))
(let ((tmp (mkstemp! (string-copy "/tmp/colt-XXXXXX"))))
(display content tmp)
(force-output tmp)
(let ((cmdline (format #f "git hash-object -t ~a -w ~a"
type (port-filename tmp))))
(one-line-result ,cmdline))))
;; file-id -> file-path -> oct-int -> void
(define (git-update-index op file-id file-path mode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment