Created
July 23, 2015 01:11
-
-
Save smoofra/9e43a61492867c3a70d4 to your computer and use it in GitHub Desktop.
Homebrew snippet to use a git branch as a patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GitPatchDownloadStrategy < GitDownloadStrategy | |
def initialize name, resource | |
super | |
@baseref = meta[:base] | |
end | |
def stage | |
Homebrew.system("git", "-C", cached_location, "diff", @baseref, @ref) do | |
$stdout.reopen('patch') | |
end | |
end | |
end | |
#patch :p1 do | |
# url "https://github.com/foo/bar.git", :using => GitPatchDownloadStrategy, :base => "some-tag" | |
#end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment