### Background
Given a repo that does not have branch named `master` and a formula like this:
```ruby
class Example < Formula
stable do
url "https://github.com/user/example.git", revision: "e8b123de62e0faec283c3253c6ea5495a332007e"
end
end
```
Homebrew was executing this when the cached location did not exist:
```
git clone https://github.com/user/example.git /path/to/cache
```
(which would work)
and this when the cached location did exist:
```
git -C /path/to/cache config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git -C /path/to/cache fetch origin
```
(which would always fail with `fatal: couldn't find remote ref refs/heads/master`)
This commit changes the value for `remote.origin.fetch` to `+refs/heads/*:refs/remotes/origin/*` which is [Git's default value for the refspec](https://git-scm.com/book/en/v2/Git-Internals-The-Refspec) anyway.
This may increase the latency of `git fetch origin` for formulae that use `:revision` because Git will now fetch all remote refs; but it does have the advantage of not being broken 🙂
Homebrew Ruby API
This is the API for Homebrew.
The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.
You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.
Good luck!