Skip to content

Ensure only fully matching symrefs are deleted #1038

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

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

westphahl
Copy link
Contributor

Deleting a symbolic ref with e.g. the name 'refs/remotes/origin/mas'
would also delete 'refs/remotes/origin/master' if the ref had to be
deleted from the pack file.

In order to fix this the full ref is now checked for a match.

Deleting a symbolic ref with e.g. the name 'refs/remotes/origin/mas'
would also delete 'refs/remotes/origin/master' if the ref had to be
deleted from the pack file.

In order to fix this the full ref is now checked for a match.
@westphahl westphahl force-pushed the fix-symbolic-delete branch from 0803ee4 to 027fd13 Compare July 17, 2020 13:56
@westphahl
Copy link
Contributor Author

Any pointers on how to test this would be appreciated. The problem is that I need a repo with the remote still in the pack file to exercise the changed code path.

@Byron
Copy link
Member

Byron commented Aug 6, 2020

My apologies for the late reply, I do try to prioritize PRs and mistook it as an issue.

That said, the tests seems to succeed despite the changes, which might mean that the behaviour described here is not actually intended.
Maybe it would be possible to add a test which tries to reproduce the undesirable behaviour, which in turn is fixed with this patch.

Please let me know if you have any issues or lack the time to dive into it, as my disposition here is to merge anyway.

@westphahl
Copy link
Contributor Author

I don't know a way to create a git repo that has the remote still in the pack file, as that would be needed to reproduce the issue. We are using a patched version of GitPython for some time now and don't see the described behavior anymore.

In case you also don't know a way to setup a git repo with the remote in the pack file I'd be glad if you could merge it as is.

@Byron
Copy link
Member

Byron commented Aug 12, 2020

Sometimes a little nudge is all it takes - let's merge and hope for the best.
Thanks again for taking this on, it's much appreciated!

@Byron Byron merged commit 6ef3775 into gitpython-developers:master Aug 12, 2020
@Byron Byron added this to the v3.1.8 - Bugfixes milestone Aug 12, 2020
@westphahl westphahl deleted the fix-symbolic-delete branch August 12, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants