Unset GIT_DIR and other variables before updating (#165818)
`update_engine_version.{ps1|sh}` needs to operate on a foreign
repository.
When flutter is run in a git-hook, these environment variables will
override our git calls location and corrupt the install.
fixes: #165390
This commit is contained in:
committed by
GitHub
parent
844c31a683
commit
2250d3988b
@@ -23,6 +23,11 @@
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# When called from a submodule hook; these will override `git -C dir`
|
||||
$env:GIT_DIR = $null
|
||||
$env:GIT_INDEX_FILE = $null
|
||||
$env:GIT_WORK_TREE = $null
|
||||
|
||||
$progName = Split-Path -parent $MyInvocation.MyCommand.Definition
|
||||
$flutterRoot = (Get-Item $progName).parent.parent.FullName
|
||||
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
# When called from a submodule hook; these will override `git -C dir`
|
||||
unset GIT_DIR
|
||||
unset GIT_INDEX_FILE
|
||||
unset GIT_WORK_TREE
|
||||
|
||||
FLUTTER_ROOT="$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")"
|
||||
|
||||
# Generate a bin/cache directory, which won't initially exist for a fresh checkout.
|
||||
|
||||
Reference in New Issue
Block a user