update: use lock

Closes #181.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2016-05-10 20:16:25 +08:00
parent ad8f50ec6d
commit 1b6a200809

View File

@ -5,6 +5,8 @@
#: If `--merge` is specified then `git merge` is used to include updates
#: (rather than `git rebase`).
source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
brew() {
"$HOMEBREW_BREW_FILE" "$@"
}
@ -307,6 +309,9 @@ EOS
# ensure GIT_CONFIG is unset as we need to operate on .git/config
unset GIT_CONFIG
# only allow one instance of brew update
lock update
chdir "$HOMEBREW_REPOSITORY"
git_init_if_necessary
# rename Taps directories