Support a local repo as URL in 'treesit-language-source-alist'
Sometimes people may need to bisect to find specific revision
in a grammar library's repo. In this case they'd want to point
the URL to the local repo to avoid cloning it on every rebuild.
So add support for a directory instead of URL in
'treesit-language-source-alist'.
* lisp/treesit.el (treesit--install-language-grammar-1): Test
if URL is a local directory. Then if it is, avoid cloning the
repo and removing the path on success.
(treesit--git-clone-repo): Factor out the code for cloning to
a separate function.
(treesit--git-checkout-branch): A helper to checkout the
revision for cases where we didn't clone the repo but want it
to point the revision. (Bug#68579)
(cherry picked from commit
54c6588952b469df8d7983b6735461f542cd806e)