Reduce minimum required git to 2.23

Thanks to raxod502/straight.el@7ca94a7, which was included in 3329448bd.
This in particular reduces the burden for Ubuntu users.

Relevant to #5088, #5096
This commit is contained in:
Henrik Lissner 2021-06-01 15:59:54 -04:00
parent 3329448bd5
commit 1a5f4afd0d
4 changed files with 11 additions and 29 deletions

View file

@ -132,8 +132,8 @@ uses a straight or package.el command directly).")
(and (string-match "\\_<[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)\\_>" version)
(match-string 0 version))))
(if version
(when (version< version "2.28")
(user-error "Git %s detected! Doom requires git 2.28 or newer!"
(when (version< version "2.23")
(user-error "Git %s detected! Doom requires git 2.23 or newer!"
version)))))
(print! (start "Installing straight..."))
(print-group!
@ -159,10 +159,8 @@ uses a straight or package.el command directly).")
"--branch" straight-repository-branch))
(make-directory repo-dir 'recursive)
(let ((default-directory repo-dir))
;; git init's -b switch was introduced in 2.28. As much as I'd
;; like to, the dependency is unavoidable because straight.el
;; uses it internally.
(funcall call "git" "init" "-b" straight-repository-branch)
(funcall call "git" "init")
(funcall call "git" "branch" "-m" straight-repository-branch)
(funcall call "git" "remote" "add" "origin" repo-url
"--master" straight-repository-branch)
(funcall call "git" "fetch" "origin" pin