Fix bump-formula-pr when working with a shallow git clone
Creating a fork and pushing to it doesn't work when the repository in question is a shallow clone. By default, Homebrew clones all taps in shallow mode unless `--full` was passed or $HOMEBREW_DEVELOPER was set.
This commit is contained in:
parent
13576111e0
commit
b3ef9ccb8a
@ -287,6 +287,7 @@ module Homebrew
|
|||||||
formula.path.parent.cd do
|
formula.path.parent.cd do
|
||||||
branch = "#{formula.name}-#{new_formula_version}"
|
branch = "#{formula.name}-#{new_formula_version}"
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
|
ohai "git fetch --unshallow origin"
|
||||||
ohai "git checkout --no-track -b #{branch} origin/master"
|
ohai "git checkout --no-track -b #{branch} origin/master"
|
||||||
ohai "git commit --no-edit --verbose --message='#{formula.name} #{new_formula_version}#{devel_message}' -- #{formula.path}"
|
ohai "git commit --no-edit --verbose --message='#{formula.name} #{new_formula_version}#{devel_message}' -- #{formula.path}"
|
||||||
ohai "hub fork --no-remote"
|
ohai "hub fork --no-remote"
|
||||||
@ -296,6 +297,7 @@ module Homebrew
|
|||||||
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
|
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
|
||||||
ohai "git checkout -"
|
ohai "git checkout -"
|
||||||
else
|
else
|
||||||
|
safe_system "git", "fetch", "--unshallow", "origin"
|
||||||
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
|
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
|
||||||
safe_system "git", "commit", "--no-edit", "--verbose",
|
safe_system "git", "commit", "--no-edit", "--verbose",
|
||||||
"--message=#{formula.name} #{new_formula_version}#{devel_message}",
|
"--message=#{formula.name} #{new_formula_version}#{devel_message}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user