Merge pull request #8391 from Bo98/update-reset-multirelative
cmd/update-reset: fix handling of multiple relative directories
This commit is contained in:
commit
d2f10b0c90
@ -35,16 +35,15 @@ homebrew-update-reset() {
|
|||||||
for DIR in "${REPOS[@]}"
|
for DIR in "${REPOS[@]}"
|
||||||
do
|
do
|
||||||
[[ -d "$DIR/.git" ]] || continue
|
[[ -d "$DIR/.git" ]] || continue
|
||||||
cd "$DIR" || continue
|
|
||||||
ohai "Fetching $DIR..."
|
ohai "Fetching $DIR..."
|
||||||
git fetch --force --tags origin
|
git -C "$DIR" fetch --force --tags origin
|
||||||
git remote set-head origin --auto >/dev/null
|
git -C "$DIR" remote set-head origin --auto >/dev/null
|
||||||
echo
|
echo
|
||||||
|
|
||||||
ohai "Resetting $DIR..."
|
ohai "Resetting $DIR..."
|
||||||
head="$(git symbolic-ref refs/remotes/origin/HEAD)"
|
head="$(git -C "$DIR" symbolic-ref refs/remotes/origin/HEAD)"
|
||||||
head="${head#refs/remotes/origin/}"
|
head="${head#refs/remotes/origin/}"
|
||||||
git checkout --force -B "$head" origin/HEAD
|
git -C "$DIR" checkout --force -B "$head" origin/HEAD
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user