Set initial_version to nil when git describe fails.
This commit is contained in:
parent
5198ad4277
commit
211e8538ec
@ -59,7 +59,7 @@ HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbr
|
|||||||
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
|
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
|
||||||
if [[ -z "$HOMEBREW_VERSION" ]]
|
if [[ -z "$HOMEBREW_VERSION" ]]
|
||||||
then
|
then
|
||||||
HOMEBREW_VERSION=">=1.4.0 (shallow or no git repository)"
|
HOMEBREW_VERSION=">=1.7.1 (shallow or no git repository)"
|
||||||
HOMEBREW_USER_AGENT_VERSION="1.X.Y"
|
HOMEBREW_USER_AGENT_VERSION="1.X.Y"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -62,10 +62,12 @@ module Homebrew
|
|||||||
updated = true
|
updated = true
|
||||||
end
|
end
|
||||||
|
|
||||||
initial_version = Version.new(system_command!("git",
|
out, _, status = system_command("git",
|
||||||
args: ["describe", "--tags", "--abbrev=0", initial_revision],
|
args: ["describe", "--tags", "--abbrev=0", initial_revision],
|
||||||
chdir: HOMEBREW_REPOSITORY,
|
chdir: HOMEBREW_REPOSITORY,
|
||||||
print_stderr: false).stdout)
|
print_stderr: false)
|
||||||
|
|
||||||
|
initial_version = Version.new(out) if status.success?
|
||||||
|
|
||||||
updated_taps = []
|
updated_taps = []
|
||||||
Tap.each do |tap|
|
Tap.each do |tap|
|
||||||
@ -186,7 +188,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def migrate_cache_entries_to_double_dashes(initial_version)
|
def migrate_cache_entries_to_double_dashes(initial_version)
|
||||||
return if initial_version > "1.7.1"
|
return if initial_version && initial_version > "1.7.1"
|
||||||
|
|
||||||
return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA")
|
return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user