You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for the get() method for SubmoduleCollection indicates that the function returns None if the submodule is not found.
However, the following sample script throws <class 'ValueError'> submodule 'second' has not been added yet.
importtempfilefrompygit2importinit_repository# This should print "Success"withtempfile.TemporaryDirectory() asprefix:
first_prefix=f'{prefix}/first'second_prefix=f'{first_prefix}/second'first=init_repository(first_prefix)
second=init_repository(second_prefix)
try:
assertfirst.submodules.get('second') isNoneprint('Success')
exceptExceptionase:
print(type(e), e)