Skip to content

Commit b32ef65

Browse files
committed
Improve order of imports and __all__ in git.repo submodules
1 parent b25dd7e commit b32ef65

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Diff for: git/repo/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from __future__ import annotations
77

8+
__all__ = ("Repo",)
9+
810
import gc
911
import logging
1012
import os
@@ -92,8 +94,6 @@
9294

9395
_logger = logging.getLogger(__name__)
9496

95-
__all__ = ("Repo",)
96-
9797

9898
class BlameEntry(NamedTuple):
9999
commit: Dict[str, Commit]

Diff for: git/repo/fun.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,31 @@
55

66
from __future__ import annotations
77

8+
__all__ = (
9+
"rev_parse",
10+
"is_git_dir",
11+
"touch",
12+
"find_submodule_git_dir",
13+
"name_to_object",
14+
"short_to_long",
15+
"deref_tag",
16+
"to_commit",
17+
"find_worktree_git_dir",
18+
)
19+
820
import os
921
import os.path as osp
1022
from pathlib import Path
1123
import stat
1224
from string import digits
1325

26+
from gitdb.exc import BadName, BadObject
27+
1428
from git.cmd import Git
1529
from git.exc import WorkTreeRepositoryUnsupported
1630
from git.objects import Object
1731
from git.refs import SymbolicReference
18-
from git.util import hex_to_bin, bin_to_hex, cygpath
19-
from gitdb.exc import BadName, BadObject
32+
from git.util import cygpath, bin_to_hex, hex_to_bin
2033

2134
# Typing ----------------------------------------------------------------------
2235

@@ -29,22 +42,11 @@
2942
from git.objects import Commit, TagObject
3043
from git.refs.reference import Reference
3144
from git.refs.tag import Tag
45+
3246
from .base import Repo
3347

3448
# ----------------------------------------------------------------------------
3549

36-
__all__ = (
37-
"rev_parse",
38-
"is_git_dir",
39-
"touch",
40-
"find_submodule_git_dir",
41-
"name_to_object",
42-
"short_to_long",
43-
"deref_tag",
44-
"to_commit",
45-
"find_worktree_git_dir",
46-
)
47-
4850

4951
def touch(filename: str) -> str:
5052
with open(filename, "ab"):

0 commit comments

Comments
 (0)