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>