Function: treesit--git-clone-repo

treesit--git-clone-repo is a byte-compiled function defined in treesit.el.gz.

Signature

(treesit--git-clone-repo URL REVISION WORKDIR)

Documentation

Clone repo pointed by URL at commit REVISION to WORKDIR.

REVISION may be nil, in which case the cloned repo will be at its default branch.

Use shallow clone by default. Do a full clone when treesit--install-language-grammar-full-clone is t. Do a blobless clone if treesit--install-language-grammar-blobless is t.

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit--git-clone-repo (url revision workdir)
  "Clone repo pointed by URL at commit REVISION to WORKDIR.

REVISION may be nil, in which case the cloned repo will be at its
default branch.

Use shallow clone by default.  Do a full clone when
`treesit--install-language-grammar-full-clone' is t.  Do a blobless
clone if `treesit--install-language-grammar-blobless' is t."
  (message "Cloning repository")
  ;; git clone xxx --depth 1 --quiet [-b yyy] workdir
  (let ((args (list "git" nil t nil "clone" url "--quiet")))
    (when (not treesit--install-language-grammar-full-clone)
      (setq args (append args (list "--depth" "1"))))
    (when treesit--install-language-grammar-blobless
      (setq args (append args (list "--filter=blob:none"))))
    (when revision
      (setq args (append args (list "-b" revision))))
    (setq args (append args (list workdir)))
    (apply #'treesit--call-process-signal args)))