Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push with refspec #2542

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

vlad-anger
Copy link

@vlad-anger vlad-anger commented Mar 1, 2025

Fixes #2537

git2 merged necessary PR

This PR is_blocked until new version git2 lib released
For now use git2 from master to be able to test PR.


Assume git config:

[branch "oblava"]
	remote = origin
	merge = refs/heads/master

Prev. behavior:
push -> push oblava -> remote oblava <- new remote created

New behavior:
push -> push oblava -> remote master


I followed the checklist:

  • I added unittests (i edited existed tests. If code did not pass tests -> edit tests. Obvio)
  • I ran make check without errors (see commit with tests fixes)
  • I tested the overall application
  • I added an appropriate item to the changelog

As prev. behavior was pushing without `brach.*.merge` check,
situation like

`r1branch.merge = refs/heads/master`

would end up pushing to remote r1branch.
Which is changed in prev. commits.
New behavior would push to remote master

To comply with tests, this commit enchance `clone_branch_commit_push`
by _explicitly_ resetting branch upstream.
So on push it will create new remote ref, as nothing was configured.

This behavior is expected to happen in `test_remotes_of_branches` test
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.

Failure to follow config push settings
1 participant