fix: check upstream even when origin/main has no new commits

The upstream sync logic only ran after a successful origin pull,
so forks whose origin/main was already in sync with local (but
behind upstream/main) would bail out with "Already up to date!"
without ever checking upstream.
This commit is contained in:
Franci Penov 2026-04-03 14:14:30 -07:00 committed by kshitij
parent e8955f222c
commit 6f2a2f157f

View file

@ -8928,6 +8928,11 @@ def _cmd_update_impl(args, gateway_mode: bool):
if commit_count == 0:
_invalidate_update_cache()
# Even if origin is up to date, the fork may be behind upstream
if is_fork and branch == "main":
_sync_with_upstream_if_needed(git_cmd, PROJECT_ROOT)
# Restore stash and switch back to original branch if we moved
if auto_stash_ref is not None:
_restore_stashed_changes(