File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -360,17 +360,17 @@ def _commit_sha_of_tree(self, tree: str) -> Optional[str]:
360360 if self .__subdir :
361361 # For subdirectories, we need to check the subdirectory tree hash
362362 for line in self ._git .command ("log" , "--all" , "--format=%H" ).splitlines ():
363- subdir_tree_hash = self ._subdir_tree_hash (
364- line , suppress_abort = True
365- )
363+ subdir_tree_hash = self ._subdir_tree_hash (line , suppress_abort = True )
366364 if subdir_tree_hash == tree :
367365 return line
368366 return None
369367 else :
370368 return self ._git .commit_sha_of_tree (tree )
371369
372- def _subdir_tree_hash (self , commit_sha : str , * , suppress_abort : bool ) -> Optional [str ]:
373- """Return the tree hash for a subdirectory of a commit, optionally suppressing Abort."""
370+ def _subdir_tree_hash (
371+ self , commit_sha : str , * , suppress_abort : bool
372+ ) -> Optional [str ]:
373+ """Return subdir tree hash for a commit; optionally suppress Abort."""
374374 if not self .__subdir :
375375 return None
376376 arg = f"{ commit_sha } :{ self .__subdir } "
Original file line number Diff line number Diff line change @@ -281,7 +281,10 @@ def test_commit_sha_of_tree_from_branch_subdir(logger):
281281
282282 r ._repo .get_commits .assert_called_with (sha = "master" , since = since )
283283 r ._git .command .assert_has_calls (
284- [call ("rev-parse" , "abc:path/to/package" ), call ("rev-parse" , "sha:path/to/package" )]
284+ [
285+ call ("rev-parse" , "abc:path/to/package" ),
286+ call ("rev-parse" , "sha:path/to/package" ),
287+ ]
285288 )
286289 logger .debug .assert_not_called ()
287290
@@ -301,7 +304,10 @@ def test_commit_sha_of_tree_from_branch_subdir_rev_parse_failure(logger):
301304 "rev-parse failed while inspecting %s" , "abc:path/to/package"
302305 )
303306 r ._git .command .assert_has_calls (
304- [call ("rev-parse" , "abc:path/to/package" ), call ("rev-parse" , "sha:path/to/package" )]
307+ [
308+ call ("rev-parse" , "abc:path/to/package" ),
309+ call ("rev-parse" , "sha:path/to/package" ),
310+ ]
305311 )
306312
307313
You can’t perform that action at this time.
0 commit comments