Skip to content

figure out remote branch properly with v6#662

Merged
Soph merged 2 commits intomainfrom
soph/fix-remote-merging-with-v6
Mar 9, 2026
Merged

figure out remote branch properly with v6#662
Soph merged 2 commits intomainfrom
soph/fix-remote-merging-with-v6

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Mar 8, 2026

Turns out the old code worked with v5 but was not really correct FETCH_HEAD is not a direct ref, this should make it work with go-git v6 again

@Soph Soph requested a review from a team as a code owner March 8, 2026 08:47
Copilot AI review requested due to automatic review settings March 8, 2026 08:47
@cursor
Copy link
Copy Markdown

cursor bot commented Mar 8, 2026

PR Summary

Low Risk
Small, localized change to git ref lookup during fetch+merge; main risk is incorrect ref resolution for some remotes/branches causing sync failures.

Overview
Fixes session-log branch sync to read the fetched remote tip from the remote-tracking ref (refs/remotes/<remote>/<branch>) instead of FETCH_HEAD, and uses that hash as the second parent when creating the merge commit.

This updates the error messaging accordingly and should restore correct behavior with go-git/v6 where FETCH_HEAD is not a normal reference.

Written by Cursor Bugbot for commit dbc5e43. Configure here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the session-branch fetch+merge recovery logic to work correctly with go-git v6 by avoiding reliance on FETCH_HEAD (which isn’t a normal ref that go-git can resolve).

Changes:

  • Resolve the remote commit via the remote-tracking ref (refs/remotes/<remote>/<branch>) instead of FETCH_HEAD.
  • Use the remote-tracking ref hash as the second parent when creating the merge commit.

Comment thread cmd/entire/cli/strategy/push_common.go
khaong
khaong previously approved these changes Mar 8, 2026
Entire-Checkpoint: 217e7dcaa8ed
@Soph Soph force-pushed the soph/fix-remote-merging-with-v6 branch from bd7f9ef to 76575e8 Compare March 9, 2026 09:52
@Soph Soph enabled auto-merge March 9, 2026 09:54
@Soph Soph disabled auto-merge March 9, 2026 09:55
@Soph Soph enabled auto-merge March 9, 2026 09:56
@Soph Soph merged commit 5dd8dca into main Mar 9, 2026
3 checks passed
@Soph Soph deleted the soph/fix-remote-merging-with-v6 branch March 9, 2026 09:57
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.

4 participants