The length of the commit hash returned for `--short` can vary depending
on user configuration. Make sure this works independently of what might
have been configured via a user's `.gitconfig`. This also fixes the
failing `GitDownloadStrategyTests#test_last_commit` test for such users.
Implement:
* VCSDownloadStrategy#last_commit
Use last modified file timestamp
* SubversionDownloadStrategy#last_commit
Use `svn info --show-item revision`
* GitDownloadStrategy#last_commit
Use `git rev-parse HEAD`
* MercurialDownloadStrategy#last_commit
Use `hg parent --template {node}`
* BazaarDownloadStrategy#last_commit
Use `bazaar revno`
* FossilDownloadStrategy#last_commit
Use `fossil info tip`
Some Git versions create absolute `gitdir:` pointers in a submodule's
`.git` file, which can be problematic once the resource is staged and
causes various Git operations for those submodules to fail. Work around
this issue by fixing the submodule `.git` files after submodule update.
See Homebrew/homebrew-core#1520 for details and an affected formula.
This mainly fixes the problems for subclasses of CurlDownloadStrategy.
More specifically it fixes two things:
* It allows the no insecure redirect check to be applied to
CurlApacheMirrorDownloadStrategy.
* It fixes previous broken CurlPostDownloadStrategy.
Closes#280.
Signed-off-by: Xu Cheng <xucheng@me.com>
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
Moves the "Checking out" output to where checkouts actually happen, to avoid spurious checkout announcements.
ClosesHomebrew/homebrew#45019.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
The ASF now has a preferred .lua mirror script on top of the .cgi file
ClosesHomebrew/homebrew#43521.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This allows some curl options to be always passed to curl, with raw
head calls (`curl -I`) (in `CurlDownloadStrategy#actual_urls`) or with
actual `curl` (in `CurlDownloadStrategy#curl`).
This also avoid the need for overriding whole `_fetch` in a few cases
and just override `_curl_opts` to append additional options instead.
ClosesHomebrew/homebrew#41506.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Adds some added security to Git tags so we are able to provide an
effective checksum rather than letting them be changed without our
knowing.
Also:
- Reprioritise ref_types. Tag should take priority over branch and revisions over a single one.
- Add current_revision method. Used to verify the current repository revision matches the specified
revision. Currently only implemented for Git.