Merge pull request #13187 from maxim-belkin/creating-new-tap
update/update-reset: warn when no origin remote
This commit is contained in:
commit
b6e8097cf5
@ -17,6 +17,7 @@ git() {
|
||||
}
|
||||
|
||||
homebrew-update-reset() {
|
||||
local option
|
||||
local DIR
|
||||
local -a REPOS=()
|
||||
|
||||
@ -50,6 +51,11 @@ homebrew-update-reset() {
|
||||
for DIR in "${REPOS[@]}"
|
||||
do
|
||||
[[ -d "${DIR}/.git" ]] || continue
|
||||
if ! git -C "${DIR}" config --local --get remote.origin.url &>/dev/null
|
||||
then
|
||||
opoo "No remote 'origin' in ${DIR}, skipping update and reset!"
|
||||
continue
|
||||
fi
|
||||
ohai "Fetching ${DIR}..."
|
||||
git -C "${DIR}" fetch --force --tags origin
|
||||
git -C "${DIR}" remote set-head origin --auto >/dev/null
|
||||
|
||||
@ -555,6 +555,12 @@ EOS
|
||||
[[ -d "${DIR}/.git" ]] || continue
|
||||
cd "${DIR}" || continue
|
||||
|
||||
if ! git config --local --get remote.origin.url &>/dev/null
|
||||
then
|
||||
opoo "No remote 'origin' in ${DIR}, skipping update!"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ -n "${HOMEBREW_VERBOSE}" ]]
|
||||
then
|
||||
echo "Checking if we need to fetch ${DIR}..."
|
||||
@ -706,6 +712,11 @@ EOS
|
||||
|
||||
[[ -d "${DIR}/.git" ]] || continue
|
||||
cd "${DIR}" || continue
|
||||
if ! git config --local --get remote.origin.url &>/dev/null
|
||||
then
|
||||
# No need to display a (duplicate) warning here
|
||||
continue
|
||||
fi
|
||||
|
||||
TAP_VAR="$(repo_var "${DIR}")"
|
||||
UPSTREAM_BRANCH_VAR="UPSTREAM_BRANCH${TAP_VAR}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user