Fix: Set upstream after rebase

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-03-10 18:28:46 +01:00
parent eebcadfaf5
commit 0dd8596f00
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -74,7 +74,6 @@ function run_restore() {
info "Setting up remote..." info "Setting up remote..."
git remote add origin "${REMOTE}" git remote add origin "${REMOTE}"
git branch -u origin "${BRANCH}"
info "Fetching remote to reset..." info "Fetching remote to reset..."
git fetch ${REMOTE} ${BRANCH} || { git fetch ${REMOTE} ${BRANCH} || {
@ -84,6 +83,7 @@ function run_restore() {
info "Resetting to remote state..." info "Resetting to remote state..."
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
git branch -u origin/"${BRANCH}" "${BRANCH}"
[[ -z $CHOWN_UID ]] || chown -R ${CHOWN_UID}:${CHOWN_GID} . [[ -z $CHOWN_UID ]] || chown -R ${CHOWN_UID}:${CHOWN_GID} .
} }