Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebe8f64

Browse files
committed
Added test for the recursive code path.
1 parent3f2d76b commitebe8f64

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

‎lib/git/objects/submodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ def update(self, previous_commit=None, recursive=True, force_remove=False, init=
11211121
# or defective depth. The RootSubmodule type will never process itself,
11221122
# which was done in the previous expression
11231123
ifrecursive:
1124-
type(cls)(sm.module()).update(recursive=True,force_remove=force_remove,
1124+
type(self)(sm.module()).update(recursive=True,force_remove=force_remove,
11251125
init=init,to_latest_revision=to_latest_revision)
11261126
#END handle recursive
11271127
# END for each submodule to update

‎test/git/test_submodule.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ def test_root_module(self, rwrepo):
394394
#================
395395
nsmn="newsubmodule"
396396
nsmp="submrepo"
397-
nsm=Submodule.add(rwrepo,nsmn,nsmp,url=join_path_native(self.rorepo.working_tree_dir,rsms[0].path,rsms[1].path))
397+
async_url=join_path_native(self.rorepo.working_tree_dir,rsms[0].path,rsms[1].path)
398+
nsm=Submodule.add(rwrepo,nsmn,nsmp,url=async_url)
398399
csmadded=rwrepo.index.commit("Added submodule")
399400
nsm.set_parent_commit(csmadded)
400401
assertnsm.module_exists()
@@ -466,8 +467,16 @@ def test_root_module(self, rwrepo):
466467
assertnsmmh.ref.tracking_branch()isnotNone
467468
assertnotnsmmh.is_detached
468469

469-
470470
# recursive update
471471
# =================
472472
# finally we recursively update a module, just to run the code at least once
473+
# remove the module so that it has more work
474+
assertlen(nsm.children())==1
475+
assertnsm.exists()andnsm.module_exists()andlen(nsm.children())==1
476+
# assure we pull locally only
477+
nsmc=nsm.children()[0]
478+
nsmc.config_writer().set_value('url',async_url)
479+
rm.update(recursive=True)
480+
481+
assertlen(nsm.children())==1andnsmc.module_exists()
473482

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp