Dabrien 'Dabe' Murphy 46ca68de5e Modify "git rev-parse --verify" args in "has_ref?"
Per the `git-rev-parse(1)` manpage:

  --verify Verify that exactly one parameter is provided, and that it
  can be turned into a raw 20-byte SHA-1 that can be used to access the
  object database. If so, emit it to the standard output; otherwise,
  error out.

  If you want to make sure that the output actually names an object in
  your object database and/or can be used as a specific type of object
  For example, git rev-parse "$VAR^{commit}" will make sure $VAR names
  an existing object that is a commit-ish (i.e. a commit, or an
  annotated tag that points at a commit).

That actually means that:

  git rev-parse --verify af8e768e2bd3b4398bca033998f83b0eb8874914

will _always_ return the SHA-1 hash — regardless of whether or not
that's actually a valid reference!

Thus, when `GitDownloadStragtegy#update_repo` tries to check
`has_ref?`, it mistakenly succeeds, and doesn't actually do a `git fetch
origin`.

The fix is to use:

  git rev-parse --verify "af8e768e2bd3b4398bca033998f83b0eb8874914^{commit}"

Fixes Homebrew/homebrew#31045.
Closes Homebrew/homebrew#31054.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-23 21:07:02 -05:00
2014-05-17 10:08:02 -07:00
2014-06-18 11:10:01 -05:00
2014-04-23 08:11:02 +01:00
2014-07-13 11:07:21 -07:00
2014-04-23 08:11:02 +01:00

Homebrew

Features, usage and installation instructions are summarized on the homepage.

What Packages Are Available?

  1. You can browse the Formula directory on GitHub.
  2. Or type brew search for a list.
  3. Or visit braumeister.org to browse packages online.
  4. Or visit brew desc to browse and search packages from the command line.

More Documentation

brew help or man brew or check our wiki.

Troubleshooting

First, please run brew update and brew doctor.

Second, read the Troubleshooting Checklist.

If you don't read these it will take us far longer to help you with your problem.

Who Are You?

Homebrew's current maintainers are Misty De Meo, Adam Vandenberg, Jack Nagel, Mike McQuaid and Brett Koonce.

Homebrew was originally created by Max Howell.

License

Code is under the BSD 2 Clause (NetBSD) license.

Donations

We accept tips through Gittip.

Gittip

Description
🍺 The missing package manager for macOS (or Linux)
Readme 144 MiB
4.6.25 Latest
2025-09-16 21:53:50 +00:00
Languages
Ruby 92%
Shell 5.2%
Roff 2.1%
HTML 0.5%