g review: update list of remote branches before checking for branch existence

This helps in case you deleted a remote branch using the GitHub web UI,
so the local view is outdated.

Change-Id: I98be33ea5712c66589f42b64e3462b76b84fbcc5
This commit is contained in:
Miklos Vajna 2020-10-22 14:05:33 +02:00
parent 5999a5b7cc
commit 85e51bbb53

4
g
View file

@ -28,6 +28,10 @@ if [ "$1" == "review" ]; then
REMOTE_BRANCH=private/$USER/$2
CUSTOM_BRANCH=y
fi
# So that we have an up to date view on what remote branches exist.
git fetch --prune $REMOTE
HAS_REMOTE_BRANCH=
if git rev-parse --quiet --verify $REMOTE/$REMOTE_BRANCH >/dev/null; then
HAS_REMOTE_BRANCH=y