Skip to content

fix(sync): set remote location when syncing to explicit revision#137

Open
diredex wants to merge 1 commit into
EpicGames:mainfrom
diredex:fix-sync-explicit-remote-branch-pointer
Open

fix(sync): set remote location when syncing to explicit revision#137
diredex wants to merge 1 commit into
EpicGames:mainfrom
diredex:fix-sync-explicit-remote-branch-pointer

Conversation

@diredex

@diredex diredex commented Jul 20, 2026

Copy link
Copy Markdown

Fix: Update branch Latest pointer on explicit --remote sync

Summary

Fixes a bug where syncing explicitly to a specific remote revision (lore sync <revision> --remote) would correctly update the local working copy but fail to advance the local branch's Latest pointer metadata.

As a result of the stale pointer, lore status would falsely report Local branch is behind remote, and subsequent lore sync operations would fail to realize they were already fully synced.

Root Cause

When lore sync resolves a target implicitly (without a user-provided hash), it compares local vs. remote latest pointers and appropriately sets the internal location flag to either Local or Remote. The local Latest metadata pointer is only updated at the end of the sync if location == Remote.

However, when a user explicitly provides a revision hash, this divergence resolution logic was completely bypassed. The target revision was resolved blindly, and location was never updated from its default value (Local). Consequently, the branch pointer update block was skipped entirely at the end of the sync process.

Changes

  • lore-revision/src/revision/sync.rs: Added logic in the explicit revision path to search the remote timeline (history::find_branch_point) when --remote is active. If the explicit revision exists on the remote, the location is properly set to Remote, allowing the pointer update block to execute normally.
  • scripts/test/test_sync.py: Added an automated end-to-end Python integration test (test_sync_remote_explicit_revision) that reproduces the bug structure and asserts that status and sync behave correctly post-sync.

Verification

  • Verified against the Python test_sync.py suite.
  • Rust lore-revision unit tests and standard clippy/fmt tasks pass cleanly.

@diredex
diredex force-pushed the fix-sync-explicit-remote-branch-pointer branch from 9659ae3 to d430dd9 Compare July 20, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant