-
-
Notifications
You must be signed in to change notification settings - Fork 950
Closed
Labels
Description
Here's the PoC:
#!/bin/env python3
import os
import shutil
import git
srcdir = '/tmp/src'
ipxe_src = srcdir + '/ipxe'
ipxe_git_uri = 'git://git.ipxe.org/ipxe.git'
patches_git_uri = 'https://github.com/eworm-de/ipxe.git'
if os.path.isdir(ipxe_src):
shutil.rmtree(ipxe_src)
os.makedirs(srcdir, exist_ok=True)
ipxe_repo = git.Repo.clone_from(ipxe_git_uri, ipxe_src) # all good
patches = ipxe_repo.create_remote('eworm', patches_git_uri) # still good
patches.fetch() # yep, still okay
ipxe_repo.create_head('patches_m', patches.refs.master) # works great!
ipxe_repo.create_head('patches_e', patches.refs.efi-iso-emul) # HORRIBLE BURNING DEATH
print("Congrats, the bug isn't reproduced for you")
To save you some time, "AttributeError: 'IterableList' object has no attribute 'eworm/efi'"
here's the interesting part.
patches.refs
[<git.RemoteReference "refs/remotes/eworm/branding">, <git.RemoteReference "refs/remotes/eworm/efi-iso-emul">, <git.RemoteReference "refs/remotes/eworm/master">, <git.RemoteReference "refs/remotes/eworm/no-pie">]
So it's clearly there.
>>> patches.refs.efi-iso-emul
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/git/util.py", line 879, in __getattr__
return list.__getattribute__(self, attr)
AttributeError: 'IterableList' object has no attribute 'eworm/efi'
AND it can even be done properly when referred to by the list index number:
>>> ipxe_repo.create_head('patches_e', patches.refs[1])
<git.Head "refs/heads/patches_e">