mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew.sh: fix handling of dirty git repo
We cache the output of `git describe`, but we don't check whether the cached value is valid. This fixes that.
This commit is contained in:
parent
019fc519da
commit
13115fee7d
@ -457,7 +457,9 @@ fi
|
||||
if [[ -n "${GIT_REVISION}" ]]
|
||||
then
|
||||
GIT_DESCRIBE_CACHE_FILE="${GIT_DESCRIBE_CACHE}/${GIT_REVISION}"
|
||||
if [[ -r "${GIT_DESCRIBE_CACHE_FILE}" ]]
|
||||
# Pass `--` to guard against `git` being confused by a file named `HEAD`.
|
||||
if "${HOMEBREW_GIT}" -C "${HOMEBREW_REPOSITORY}" diff-index --quiet --exit-code HEAD -- 2>/dev/null &&
|
||||
[[ -r "${GIT_DESCRIBE_CACHE_FILE}" ]]
|
||||
then
|
||||
GIT_DESCRIBE_CACHE_HOMEBREW_VERSION="$(cat "${GIT_DESCRIBE_CACHE_FILE}")"
|
||||
if [[ -n "${GIT_DESCRIBE_CACHE_HOMEBREW_VERSION}" && "${GIT_DESCRIBE_CACHE_HOMEBREW_VERSION}" != *"-dirty" ]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user