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

Ensure only fully matching symrefs are deleted #1038

Merged
merged 1 commit into from Aug 12, 2020

Conversation

@westphahl
Copy link
Contributor

@westphahl westphahl commented Jul 17, 2020

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 westphahl:fix-symbolic-delete branch from 0803ee4 to 027fd13 Jul 17, 2020
@westphahl
Copy link
Contributor Author

@westphahl westphahl commented Jul 17, 2020

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 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

@westphahl westphahl commented Aug 6, 2020

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 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
4 checks passed
4 checks passed
build (3.5)
Details
build (3.6)
Details
build (3.7)
Details
build (3.8)
Details
@Byron Byron added this to the v3.1.8 - Bugfixes milestone Aug 12, 2020
@westphahl westphahl deleted the westphahl:fix-symbolic-delete branch Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.