Skip to content

Conversation

@pb82
Copy link
Contributor

@pb82 pb82 commented Nov 12, 2025

SUMMARY

When creating a project with allow branch override and then trying to sync it after a rebase & force push, the project update fails with:

fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/git", "fetch", "--tags", "origin", "refs/heads/*:refs/remotes/origin/*"], "msg": "Failed to download remote objects and refs:  From https://github.com/pb82/ansible-tower-samples\\n ! [rejected]        master     -> origin/master  (non-fast-forward)\\n"}

Adding the force flag + fixes that.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
ADDITIONAL INFORMATION

Copy link
Contributor

@djulich djulich left a comment

Choose a reason for hiding this comment

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

lgtm



@pytest.mark.django_db
class TestProjectUpdateRefspec(TestJobExecution):
Copy link
Member

Choose a reason for hiding this comment

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

I honestly don't care much for the unit test. I don't see much value from it.

@AlanCoding AlanCoding changed the title add force flag to refspec AAP-29938 add force flag to refspec Nov 12, 2025
@AlanCoding
Copy link
Member

I think some of the dev-env test failures are from the load_credentials fixture issue.

@sonarqubecloud
Copy link

@pb82 pb82 merged commit b021179 into devel Nov 13, 2025
18 checks passed
@pb82 pb82 deleted the AAP-29938 branch November 13, 2025 13:51
Jaapis pushed a commit to Jaapis/awx that referenced this pull request Nov 27, 2025
* add force flag to refspec

* Development of git --amend test

* Update awx/main/tests/live/tests/conftest.py



---------

Co-authored-by: AlanCoding <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants