-
-
Notifications
You must be signed in to change notification settings - Fork 933
repo.remote().fetch("--dry-run") can produce assertion failure #442
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
Comments
Which version of GitPython are you using ? In case you are not using the latest version from pypi, please try again with that one. |
I'm using GitPython-2.0.3. That's the latest, right?
|
I was unable to reproduce it. Here is what I tried: import git
r = git.Repo.clone_from('https://github.com/JuliaLang/Reactive.jl', 'here')
r.remote().fetch()
r.remote().fetch('--dry-run') Does this work for you ? Maybe there is more to it, like the git version installed on the system. $ git --version
git version 2.7.4 (Apple Git-66) |
The behavior is dependent on the condition of the working copy. If I try the fetch in a freshly cloned working copy, it works just fine. |
This is what I get when running the command git-python runs from the terminal: $ git fetch -v origin
From https://github.com/JuliaLang/Reactive.jl
= [up to date] master -> origin/master
= [up to date] cjh/cleanup -> origin/cjh/cleanup
= [up to date] gh-pages -> origin/gh-pages
= [up to date] next -> origin/next
= [up to date] teh/imageview_warmups -> origin/teh/imageview_warmups Could you run that on your end ? |
|
I still can't reproduce it - even when manipulating my local repository to update the remote master: ➜ here git:(master) git fetch -v origin --dry-run
From https://github.com/JuliaLang/Reactive.jl
7a3e5e9..0c032a3 master -> origin/master
= [up to date] cjh/cleanup -> origin/cjh/cleanup
= [up to date] gh-pages -> origin/gh-pages
= [up to date] next -> origin/next
= [up to date] teh/imageview_warmups -> origin/teh/imageview_warmups Maybe it's related to the git version somehow, or to windows. In any case, what you could do is to have a look at the line that throws the assertion, and add some debug-printing yourself. That way you can find out which line it fails to handle correctly. I am not sure what else I can do here, unfortunately. Personally I'd think it does not matter whether or not you use |
Thanks for trying. In case it helps anyone,
and
That demonstrates that |
Indeed ! This assertion was the cause for many issues in the past, and so far there was no good fix for it. This is the comment at the respective line: The problem is that I never understood why git would sometimes do that, or what the correct behaviour is. Should GitPython provide only partial information, or should it simply ignore the partial data ? Currently it matches the lines one on one, maybe it's safe to just ignore extra lines in the fetch head info ... and get rid of this issue once and for all. |
Yes, my inclination would be to ignore extra lines in the fetch head info. |
Did you get that backwards? Don't you want to ignore extra lines in |
Thanks for the review ! I totally did - fix is on the way. |
Previously, the logic was not correct. Now it should work either way, truncating the correct list to assure both always have the same length. Related to #442
The text was updated successfully, but these errors were encountered: