make sure git checkout have correct perms

This commit is contained in:
Spencer Florence 2015-09-14 16:24:38 -05:00 committed by Robby Findler
parent 003bca503f
commit 35a0f0c71c

View File

@ -671,12 +671,16 @@
(when id
(define (this-object-location)
(object-location (hash-ref obj-ids id)))
(case (datum-intern-literal mode)
[(#"100644" #"644"
#"100755" #"755")
(define (copy-this-object perms)
(copy-object tmp
(this-object-location)
(build-path dest-dir fn))]
perms
(build-path dest-dir fn)))
(case (datum-intern-literal mode)
[(#"100755") #"755"
(copy-this-object #o755)]
[(#"100644" #"644")
(copy-this-object #o644)]
[(#"40000" #"040000")
(extract-tree id obj-ids tmp (build-path dest-dir fn))]
[(#"120000")
@ -938,8 +942,8 @@
[else
(call-with-input-file* (build-path (tmp-info-dir tmp) location) proc)]))
;; copy-object : tmp-info location path -> void
(define (copy-object tmp location dest-file)
;; copy-object : tmp-info location integer path -> void
(define (copy-object tmp location perms dest-file)
(cond
[(pair? location)
(define bstr (object->bytes tmp location))
@ -950,7 +954,10 @@
[else
(copy-file (build-path (tmp-info-dir tmp) location)
dest-file
#t)]))
#t)])
(if (eq? 'windows (system-type 'os))
(file-or-directory-permissions dest-file #o755)
(file-or-directory-permissions dest-file perms)))
;; object->bytes : tmp-info location -> bytes
(define (object->bytes tmp location)