Skip to content
Snippets Groups Projects
Unverified Commit d2f10b0c authored by Bo Anderson's avatar Bo Anderson Committed by GitHub
Browse files

Merge pull request #8391 from Bo98/update-reset-multirelative

cmd/update-reset: fix handling of multiple relative directories
parents a05ef25b fc7c3c92
No related branches found
No related tags found
No related merge requests found
......@@ -35,16 +35,15 @@ homebrew-update-reset() {
for DIR in "${REPOS[@]}"
do
[[ -d "$DIR/.git" ]] || continue
cd "$DIR" || continue
ohai "Fetching $DIR..."
git fetch --force --tags origin
git remote set-head origin --auto >/dev/null
git -C "$DIR" fetch --force --tags origin
git -C "$DIR" remote set-head origin --auto >/dev/null
echo
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/}"
git checkout --force -B "$head" origin/HEAD
git -C "$DIR" checkout --force -B "$head" origin/HEAD
echo
done
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment