Skip to content

Commit 4dd89af

Browse files
EliahKaganclaude
andcommitted
Match test_root_module's deep-traversal assertion to gitdb's structure
gitdb's `async` submodule was removed back in 2014 (gitpython-developers/gitdb@bf942a9); only smmap remains. The leading "gitdb / async" comment and the `assert len(rsmsp) >= 2` check (loosened back in 2011 from `== 2` in 4a8bdce when smmap was added to gitdb alongside async) are both stale. Replace with an exact list-equality check on the expected paths in traversal order. That order is also what later code in this function assumes via positional indexing `rsmsp[0]`, `rsmsp[1]`. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent de3a950 commit 4dd89af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/test_submodule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,9 @@ def test_root_module(self, rwrepo):
508508
with rm.config_writer():
509509
pass
510510

511-
# Deep traversal gitdb / async.
511+
# Deep traversal yields gitdb and its nested smmap.
512512
rsmsp = [sm.path for sm in rm.traverse()]
513-
assert len(rsmsp) >= 2 # gitdb and async [and smmap], async being a child of gitdb.
513+
assert rsmsp == ["git/ext/gitdb", "gitdb/ext/smmap"]
514514

515515
# Cannot set the parent commit as root module's path didn't exist.
516516
self.assertRaises(ValueError, rm.set_parent_commit, "HEAD")

0 commit comments

Comments
 (0)