mirror of
https://github.com/dimitri/el-get.git
synced 2024-09-29 04:58:53 +08:00
3969e02b27
* Fix Git HTTP smart host detection regression test test/issues/el-get-issue-1920.el revealed that Git HTTP smart host detection is broken. Not all hosts support the HEAD HTTP request method. For example, github.com for HEAD (let ((url-request-method "HEAD")) (url-retrieve-synchronously "https://github.com/dimitri/el-get.git/info/refs\?service\=git-upload-pack")) responds HTTP/1.1 405 Method Not Allowed Server: GitHub Babel 2.0 Content-Type: text/plain Content-Security-Policy: default-src 'none'; sandbox Content-Length: 0 X-Frame-Options: DENY X-GitHub-Request-Id: C1DA:12E32:2B6C9D7:302B1C2:61C9A4E8 while for GET (let ((url-request-method "GET")) (url-retrieve-synchronously "https://github.com/dimitri/el-get.git/info/refs\?service\=git-upload-pack")) responds HTTP/1.1 200 OK Server: GitHub Babel 2.0 Content-Type: application/x-git-upload-pack-advertisement Content-Security-Policy: default-src 'none'; sandbox Transfer-Encoding: chunked expires: Fri, 01 Jan 1980 00:00:00 GMT pragma: no-cache Cache-Control: no-cache, max-age=0, must-revalidate Vary: Accept-Encoding X-Frame-Options: DENY X-GitHub-Request-Id: C22C:5E15:3923777:3D822AC:61CA332A Other hosts like git.sr.ht do support HEAD, of course. Furthermore, the HTTP status code wasn't checked, that's why hosts like github.com would be classified as "dumb" hosts. This commit checks the HTTP status code, and if the status is not 200 or 304 for the HEAD HTTP request method, it tries GET. HEAD is tried first, because GET might be more expensive for big repositories. The regression test is adapted as well. * Fix byte compiler warnings |
||
---|---|---|
.. | ||
issues | ||
pkgs | ||
caching-speedtest.el | ||
check-recipe.el | ||
el-get-tests.el | ||
github-actions.sh | ||
README.md | ||
run-ert-interactive.sh | ||
run-ert.sh | ||
test-all-recipes.sh | ||
test-interactive.sh | ||
test-recipe-interactive.sh | ||
test-recipe.sh | ||
test-setup.el | ||
test-utils.sh |
Tests
Like, yes, we have some! :)
ERT-based tests
See el-get-tests.el
in this directory. You can run ERT-based tests by:
test/run-ert.sh
To run the tests with GUI window for debugging, you can use:
test/run-ert-interactive.sh
Old issue reproducers
See the test/issues directory.