aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMislav Marohnić2017-06-27 23:45:57 +0200
committerMislav Marohnić2017-06-27 23:45:57 +0200
commit3701b11e42a93ee9c1bb94f326ee186d4416501c (patch)
tree397b54296d6c340c55210368343d6cc6632fda57 /Library
parentb3ef9ccb8a4ab5c853c1bf683ebc9e16670f0013 (diff)
downloadbrew-3701b11e42a93ee9c1bb94f326ee186d4416501c.tar.bz2
Fix unshallowing taps in `bump-formula-pr`
Never try to unhshallow full clones.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index d65516b78..74a676d9a 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -286,8 +286,11 @@ module Homebrew
formula.path.parent.cd do
branch = "#{formula.name}-#{new_formula_version}"
+ git_dir = Utils.popen_read("git rev-parse --git-dir")
+ shallow = !git_dir.empty? && File.exist?("#{git_dir}/shallow")
+
if ARGV.dry_run?
- ohai "git fetch --unshallow origin"
+ ohai "git fetch --unshallow origin" if shallow
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 "hub fork --no-remote"
@@ -297,7 +300,7 @@ module Homebrew
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
ohai "git checkout -"
else
- safe_system "git", "fetch", "--unshallow", "origin"
+ safe_system "git", "fetch", "--unshallow", "origin" if shallow
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
safe_system "git", "commit", "--no-edit", "--verbose",
"--message=#{formula.name} #{new_formula_version}#{devel_message}",