Skip to content

Commit f631214

Browse files
committed
Submodule tests are functional once again.
remote: Fixed bug that was caused by the unchecked deletion of an uncached attribute which did not necessarily exist
1 parent 468cad6 commit f631214

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

git/remote.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,11 @@ def rename(self, new_name):
413413

414414
self.repo.git.remote("rename", self.name, new_name)
415415
self.name = new_name
416-
del(self._config_reader) # it contains cached values, section names are different now
416+
try:
417+
del(self._config_reader) # it contains cached values, section names are different now
418+
except AttributeError:
419+
pass
420+
#END handle exception
417421
return self
418422

419423
def update(self, **kwargs):
@@ -599,5 +603,9 @@ def config_writer(self):
599603
writer = self.repo.config_writer()
600604

601605
# clear our cache to assure we re-read the possibly changed configuration
602-
del(self._config_reader)
606+
try:
607+
del(self._config_reader)
608+
except AttributeError:
609+
pass
610+
#END handle exception
603611
return SectionConstraint(writer, self._config_section_name())

git/test/test_submodule.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def update(self, op, index, max_count, message=''):
2020

2121
class TestSubmodule(TestBase):
2222

23-
k_subm_current = "e1e3017788213720afcfae0accddb2a6f2d9f052"
23+
k_subm_current = "468cad66ff1f80ddaeee4123c24e4d53a032c00d"
2424
k_subm_changed = "394ed7006ee5dc8bddfd132b64001d5dfc0ffdd3"
2525
k_no_subm_tag = "0.1.6"
2626

0 commit comments

Comments
 (0)