reinstall: add support for the --git option

This commit is contained in:
Allen Reese 2021-06-09 16:26:09 -07:00
parent eec2d609bd
commit 128f63db53
2 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,9 @@ module Homebrew
env: :display_install_times,
description: "Print install times for each formula at the end of the run.",
}],
[:switch, "-g", "--git", {
description: "Create a Git repository, useful for creating patches to the software.",
}],
].each do |options|
send(*options)
conflicts "--cask", options[-2]
@ -108,6 +111,7 @@ module Homebrew
debug: args.debug?,
quiet: args.quiet?,
verbose: args.verbose?,
git: args.git?,
)
Cleanup.install_formula_clean!(formula)
end

View File

@ -19,7 +19,8 @@ module Homebrew
force: false,
debug: false,
quiet: false,
verbose: false
verbose: false,
git: false
)
if formula.opt_prefix.directory?
keg = Keg.new(formula.opt_prefix.resolved_path)
@ -44,6 +45,7 @@ module Homebrew
build_bottle: tab&.built_bottle?,
force_bottle: force_bottle,
build_from_source_formulae: build_from_source_formulae,
git: git,
interactive: interactive,
keep_tmp: keep_tmp,
force: force,