`Tap.fetch` and commands building on top of it accepted tap names like
`homebrew/homebrew/bogus` causing some misbehavior. Ensure neither
`user` nor `repo` include slashes and print a more helpful error message
that additionally includes the problematic tap name.
Closes#585.
Closes#591.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
* readall: move readall logic to new class.
* tap: run readall when tapping.
This will prevent tapping an tap with syntax errors from causing issues
for users.
Fixes#58.
Use both an in-class and a `.git/config` cache for this so we can ensure
that the `Tap#private?` check is fast. Also, make sure this cache value
is set both when initially installing and updating a tap.
Thanks to @xu-cheng for most of the implementation here.
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.
The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.
Closes#17.
Signed-off-by: ilovezfs <ilovezfs@icloud.com>
When invoking `brew tap homebrew/core`, the input options will be like
`{ :clone_target => nil }`. This renders `Hash#merge` a dead operation.
It doesn't impact Homebrew itself, but could cause problem for
downstream projects Linxubrew/Tigerbrew when they adopt core/formula
separation.
Ensure we don't munge line endings on checkout regardless with user's
global git config.
ClosesHomebrew/homebrew#50514.
Signed-off-by: Xu Cheng <xucheng@me.com>
As discovered in Homebrew/homebrew#50256, this becomes a performance bottleneck as we are
repeating construct same Pathname object.
At the same, this commit makes the behaviors between Tap and CoreTap more
consistence.
These methods will be used in `brew --version`, `brew config`
and `brew doctor` after core/formula separation.
ClosesHomebrew/homebrew#49796.
Signed-off-by: Xu Cheng <xucheng@me.com>
Return true if given path would present a Formula file in this Tap.
Accepts both absolute path and relative path (relative to this Tap's path)
It offer an abstraction such that caller would not need to worry about
low level file system in the tap.
It will be used in `brew pull` and `brew update`.
ClosesHomebrew/homebrew#49191.
Signed-off-by: Xu Cheng <xucheng@me.com>
If a tap is installed during the installation, the original cache need
to be purged. Otherwise, it will return wrong information afterwards.
ClosesHomebrew/homebrew#48887.
Signed-off-by: Xu Cheng <xucheng@me.com>
For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:
Error: uninitialized constant Formulary::CoreFormulaRepository
This is caused by the same bug described in Homebrew/homebrew#42553.
This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.
Also cleanup legacy `require "cmd/tap"`.
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.
Some benchmark:
$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total
ClosesHomebrew/homebrew#44377.
Signed-off-by: Xu Cheng <xucheng@me.com>