Skip to content

Commit

Permalink
g review: update list of remote branches before checking for branch e…
Browse files Browse the repository at this point in the history
…xistence

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

Change-Id: I98be33ea5712c66589f42b64e3462b76b84fbcc5
  • Loading branch information
vmiklos committed Oct 22, 2020
1 parent 5999a5b commit 85e51bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions g
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85e51bb

Please sign in to comment.