mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-23 06:50:23 -07:00
fix(lib): use git symbolic-ref instead of branch -m for empty repos
Fix: #8538 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
09a0f36144
commit
7902c08729
1 changed files with 5 additions and 1 deletions
|
|
@ -111,7 +111,11 @@ package's name as a symbol, and whose CDR is the plist supplied to its
|
|||
(make-directory repo-dir 'recursive)
|
||||
(let ((default-directory repo-dir))
|
||||
(funcall call "git" "init")
|
||||
(funcall call "git" "branch" "-m" straight-repository-branch)
|
||||
;; HACK: `git branch -m' fails on empty repos with git
|
||||
;; < 2.28. `git symbolic-ref' is a portable alternative
|
||||
;; that works on all git versions. See #8538.
|
||||
(funcall call "git" "symbolic-ref" "HEAD"
|
||||
(format "refs/heads/%s" straight-repository-branch))
|
||||
(funcall call "git" "remote" "add" "origin" repo-url
|
||||
"--master" straight-repository-branch)
|
||||
(funcall call "git" "fetch" "origin" pin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue