Skip to content

Commit 56a7604

Browse files
committed
fix(repositories): narrow return type of repository_merge_base to dict[str, Any]
1 parent 607dddf commit 56a7604

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

gitlab/v4/objects/repositories.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,7 @@ def repository_archive(
329329

330330
@cli.register_custom_action(cls_names="Project", required=("refs",))
331331
@exc.on_http_error(exc.GitlabGetError)
332-
def repository_merge_base(
333-
self, refs: list[str], **kwargs: Any
334-
) -> dict[str, Any] | requests.Response:
332+
def repository_merge_base(self, refs: list[str], **kwargs: Any) -> dict[str, Any]:
335333
"""Return a diff between two branches/commits.
336334
337335
Args:
@@ -351,7 +349,10 @@ def repository_merge_base(
351349
custom_types={"refs": types.ArrayAttribute},
352350
transform_data=True,
353351
)
354-
return self.manager.gitlab.http_get(path, query_data=query_data, **kwargs)
352+
result = self.manager.gitlab.http_get(path, query_data=query_data, **kwargs)
353+
if TYPE_CHECKING:
354+
assert isinstance(result, dict)
355+
return result
355356

356357
@cli.register_custom_action(cls_names="Project")
357358
@exc.on_http_error(exc.GitlabDeleteError)

0 commit comments

Comments
 (0)