Skip to content

remote.push might fail with BadName after successfully pushing #461

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

Closed
bpoldrack opened this issue Jun 2, 2016 · 3 comments
Closed

remote.push might fail with BadName after successfully pushing #461

bpoldrack opened this issue Jun 2, 2016 · 3 comments

Comments

@bpoldrack
Copy link
Contributor

bpoldrack commented Jun 2, 2016

When pushing to a remote, the creation of PushInfo might fail, while the actual push was successful.
I got this on a forced update. git reports back with the old_sha...new_sha pattern, but since the remote was not fetched before, apparently the object database doesn't know the old (short) SHA and therefore fails to expand it for PushInfo instantiation, raising BadName.
From my point of view, this should either not fail at all (since this is kind of a requirement for a push, that git itself doesn't rely on) or provide a more useful exception. If I call push with a refspec like +local_branch:remote_branch, a BadName(5OM35H4) doesn't tell me, whether I need to deal with the exception or ignore it. At least I need to know, whether it refers to the local commit object (which should be known) or the remote one.

Edit: Forgot to mention: This happened to me in a test only after upgrading from gitpython 2.0.2 to 2.0.5

@Byron
Copy link
Member

Byron commented Jun 13, 2016

Thanks for the description of the issue.
Would you have way to help me reproduce it ?

For now I can't imaging how anything that is pushed to a remote manages to not exist in the repository that it is pushed from.

@bpoldrack
Copy link
Contributor Author

It's about what git reports to be the "old SHA" of the remote, I push to. And this old one wasn't known to the repo I push from without fetching before.
I'll extract a snippet from my scenario for reproducing.

@Byron
Copy link
Member

Byron commented Jun 20, 2016

Oh, thanks for the clarification. I believe to understand the issue now.

@Byron Byron closed this as completed in 451504f Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants