Skip to content

fix(push): push renamed branch to its same-named upstream - #108

Open
patrick-cst1 wants to merge 1 commit into
the0807:mainfrom
patrick-cst1:fix/issue-97-branch-rename-push
Open

patrick-cst1 wants to merge 1 commit into
the0807:mainfrom
patrick-cst1:fix/issue-97-branch-rename-push

Conversation

@patrick-cst1

Copy link
Copy Markdown

Summary

  • git branch -m old new keeps the upstream config pointing at the old remote branch, so a bare git push fails with "The upstream branch of your current branch does not match".
  • pushCurrentBranch now detects the name mismatch and pushes refs/heads/<newName> with -u, publishing the renamed branch and retargeting the upstream; matching-name pushes are unchanged.

Related Issue

Closes #97

Changes

  • GitService.pushCurrentBranch + MainPanel routing for bare push messages.
  • Tests for the renamed-upstream path and the default path.

Type of Change

  • Bug fix
  • Test addition or update

Testing

  • New tests fail on unmodified main and pass with the fix.
  • Real git check: bare git push after a rename reproduces the reported error; git push -u origin <newname> succeeds and later bare pushes work.- npx tsc --noEmit clean.
  • Full suite on Windows: 260 pre-existing failures (POSIX-only integration helper + env), 0 new failures vs main; focused tests pass.
  • The repo's integration suite only runs on Linux (its helper uses POSIX quoting), CI covers those.

Caveats

  • The push dialog may still display the stale upstream name until the first fixed push retargets it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Cannot push a branch after renaming it, seems to hold a reference to the old name

1 participant