| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b5c3ca4 commit f444470
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -610,7 +610,7 @@ class CatFileContentStream: | |||
| 610 | 610 | stream once our sized content region is empty. | |
| 611 | 611 | ||
| 612 | 612 | If not all data are read to the end of the object's lifetime, we read the | |
| 613 | - rest to assure the underlying stream continues to work. | ||
| 613 | + rest to ensure the underlying stream continues to work. | ||
| 614 | 614 | """ | |
| 615 | 615 | ||
| 616 | 616 | __slots__: Tuple[str, ...] = ("_stream", "_nbr", "_size") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,7 @@ | |||
| 56 | 56 | T_OMD_value = TypeVar("T_OMD_value", str, bytes, int, float, bool) | |
| 57 | 57 | ||
| 58 | 58 | if sys.version_info[:3] < (3, 7, 2): | |
| 59 | - # typing.Ordereddict not added until py 3.7.2 | ||
| 59 | + # typing.Ordereddict not added until Python 3.7.2. | ||
| 60 | 60 | from collections import OrderedDict | |
| 61 | 61 | ||
| 62 | 62 | OrderedDict_OMD = OrderedDict | |
@@ -73,13 +73,10 @@ | |||
| 73 | 73 | log = logging.getLogger("git.config") | |
| 74 | 74 | log.addHandler(logging.NullHandler()) | |
| 75 | 75 | ||
| 76 | - # invariants | ||
| 77 | - # represents the configuration level of a configuration file | ||
| 78 | - | ||
| 79 | 76 | ||
| 77 | + # The configuration level of a configuration file. | ||
| 80 | 78 | CONFIG_LEVELS: ConfigLevels_Tup = ("system", "user", "global", "repository") | |
| 81 | 79 | ||
| 82 | - | ||
| 83 | 80 | # Section pattern to detect conditional includes. | |
| 84 | 81 | # https://git-scm.com/docs/git-config#_conditional_includes | |
| 85 | 82 | CONDITIONAL_INCLUDE_REGEXP = re.compile(r"(?<=includeIf )\"(gitdir|gitdir/i|onbranch):(.+)\"") | |
@@ -603,7 +600,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 603 | 600 | files_to_read = [self._file_or_files] | |
| 604 | 601 | else: # for lists or tuples | |
| 605 | 602 | files_to_read = list(self._file_or_files) | |
| 606 | - # end assure we have a copy of the paths to handle | ||
| 603 | + # end ensure we have a copy of the paths to handle | ||
| 607 | 604 | ||
| 608 | 605 | seen = set(files_to_read) | |
| 609 | 606 | num_read_include_files = 0 | |
@@ -612,7 +609,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 612 | 609 | file_ok = False | |
| 613 | 610 | ||
| 614 | 611 | if hasattr(file_path, "seek"): | |
| 615 | - # Must be a file objectfile-object. | ||
| 612 | + # Must be a file-object. | ||
| 616 | 613 | file_path = cast(IO[bytes], file_path) # TODO: Replace with assert to narrow type, once sure. | |
| 617 | 614 | self._read(file_path, file_path.name) | |
| 618 | 615 | else: | |
@@ -626,7 +623,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 626 | 623 | continue | |
| 627 | 624 | ||
| 628 | 625 | # Read includes and append those that we didn't handle yet. | |
| 629 | - # We expect all paths to be normalized and absolute (and will assure that is the case). | ||
| 626 | + # We expect all paths to be normalized and absolute (and will ensure that is the case). | ||
| 630 | 627 | if self._has_includes(): | |
| 631 | 628 | for _, include_path in self._included_paths(): | |
| 632 | 629 | if include_path.startswith("~"): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -122,8 +122,8 @@ def diff( | |||
| 122 | 122 | the respective tree. | |
| 123 | 123 | * If :class:`Index <Diffable.Index>`, it will be compared against the index. | |
| 124 | 124 | * If :attr:`git.NULL_TREE`, it will compare against the empty tree. | |
| 125 | - * It defaults to :class:`Index <Diffable.Index>` to assure the method will | ||
| 126 | - not by-default fail on bare repositories. | ||
| 125 | + * It defaults to :class:`Index <Diffable.Index>` so that the method will not | ||
| 126 | + by default fail on bare repositories. | ||
| 127 | 127 | ||
| 128 | 128 | :param paths: | |
| 129 | 129 | This a list of paths or a single path to limit the diff to. It will only | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,9 +340,9 @@ def from_tree(cls, repo: "Repo", *treeish: Treeish, **kwargs: Any) -> "IndexFile | |||
| 340 | 340 | resolve more cases in a commonly correct manner. Specify trivial=True as kwarg | |
| 341 | 341 | to override that. | |
| 342 | 342 | ||
| 343 | - As the underlying git-read-tree command takes into account the current index, | ||
| 344 | - it will be temporarily moved out of the way to assure there are no unsuspected | ||
| 345 | - interferences. | ||
| 343 | + As the underlying git-read-tree command takes into account the current | ||
| 344 | + index, it will be temporarily moved out of the way to prevent any unexpected | ||
| 345 | + interference. | ||
| 346 | 346 | """ | |
| 347 | 347 | if len(treeish) == 0 or len(treeish) > 3: | |
| 348 | 348 | raise ValueError("Please specify between 1 and 3 treeish, got %i" % len(treeish)) | |
@@ -366,7 +366,7 @@ def from_tree(cls, repo: "Repo", *treeish: Treeish, **kwargs: Any) -> "IndexFile | |||
| 366 | 366 | # Move current index out of the way - otherwise the merge may fail | |
| 367 | 367 | # as it considers existing entries. Moving it essentially clears the index. | |
| 368 | 368 | # Unfortunately there is no 'soft' way to do it. | |
| 369 | - # The TemporaryFileSwap assure the original file get put back. | ||
| 369 | + # The TemporaryFileSwap ensures the original file gets put back. | ||
| 370 | 370 | ||
| 371 | 371 | stack.enter_context(TemporaryFileSwap(join_path_native(repo.git_dir, "index"))) | |
| 372 | 372 | repo.git.read_tree(*arg_list, **kwargs) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ def update( | |||
| 133 | 133 | ||
| 134 | 134 | if progress is None: | |
| 135 | 135 | progress = RootUpdateProgress() | |
| 136 | - # END assure progress is set | ||
| 136 | + # END ensure progress is set | ||
| 137 | 137 | ||
| 138 | 138 | prefix = "" | |
| 139 | 139 | if dry_run: | |
@@ -300,7 +300,7 @@ def update( | |||
| 300 | 300 | smr.rename(orig_name) | |
| 301 | 301 | ||
| 302 | 302 | # Early on, we verified that the our current tracking branch | |
| 303 | - # exists in the remote. Now we have to assure that the | ||
| 303 | + # exists in the remote. Now we have to ensure that the | ||
| 304 | 304 | # sha we point to is still contained in the new remote | |
| 305 | 305 | # tracking branch. | |
| 306 | 306 | smsha = sm.binsha | |
@@ -367,7 +367,7 @@ def update( | |||
| 367 | 367 | except OSError: | |
| 368 | 368 | # ...or reuse the existing one. | |
| 369 | 369 | tbr = git.Head(smm, sm.branch_path) | |
| 370 | - # END assure tracking branch exists | ||
| 370 | + # END ensure tracking branch exists | ||
| 371 | 371 | ||
| 372 | 372 | tbr.set_tracking_branch(find_first_remote_branch(smmr, sm.branch_name)) | |
| 373 | 373 | # NOTE: All head-resetting is done in the base implementation of update | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,8 +180,8 @@ def add(self, sha: bytes, mode: int, name: str, force: bool = False) -> "TreeMod | |||
| 180 | 180 | return self | |
| 181 | 181 | ||
| 182 | 182 | def add_unchecked(self, binsha: bytes, mode: int, name: str) -> None: | |
| 183 | - """Add the given item to the tree. Its correctness is assumed, which | ||
| 184 | - puts the caller into responsibility to assure the input is correct. | ||
| 183 | + """Add the given item to the tree. Its correctness is assumed, so it is the | ||
| 184 | + caller's responsibility to ensure that the input is correct. | ||
| 185 | 185 | ||
| 186 | 186 | For more information on the parameters, see :meth:`add`. | |
| 187 | 187 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1448,7 +1448,7 @@ def archive( | |||
| 1448 | 1448 | path = cast(Union[PathLike, List[PathLike], Tuple[PathLike, ...]], path) | |
| 1449 | 1449 | if not isinstance(path, (tuple, list)): | |
| 1450 | 1450 | path = [path] | |
| 1451 | - # end assure paths is list | ||
| 1451 | + # end ensure paths is list (or tuple) | ||
| 1452 | 1452 | self.git.archive("--", treeish, *path, **kwargs) | |
| 1453 | 1453 | return self | |
| 1454 | 1454 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -283,7 +283,7 @@ def to_native_path_linux(path: PathLike) -> str: | |||
| 283 | 283 | def join_path_native(a: PathLike, *p: PathLike) -> PathLike: | |
| 284 | 284 | R"""Like join_path, but makes sure an OS native path is returned. | |
| 285 | 285 | ||
| 286 | - This is only needed to play it safe on Windows and to assure nice paths that only | ||
| 286 | + This is only needed to play it safe on Windows and to ensure nice paths that only | ||
| 287 | 287 | use '\'. | |
| 288 | 288 | """ | |
| 289 | 289 | return to_native_path(join_path(a, *p)) | |
@@ -1185,8 +1185,8 @@ def __init__(cls, name: str, bases: Tuple, clsdict: Dict) -> None: | |||
| 1185 | 1185 | ||
| 1186 | 1186 | ||
| 1187 | 1187 | class Iterable(metaclass=IterableClassWatcher): | |
| 1188 | - """Defines an interface for iterable items which is to assure a uniform | ||
| 1189 | - way to retrieve and iterate items within the git repository.""" | ||
| 1188 | + """Defines an interface for iterable items, so there is a uniform way to retrieve | ||
| 1189 | + and iterate items within the git repository.""" | ||
| 1190 | 1190 | ||
| 1191 | 1191 | __slots__ = () | |
| 1192 | 1192 | ||
@@ -1221,8 +1221,8 @@ def iter_items(cls, repo: "Repo", *args: Any, **kwargs: Any) -> Any: | |||
| 1221 | 1221 | ||
| 1222 | 1222 | @runtime_checkable | |
| 1223 | 1223 | class IterableObj(Protocol): | |
| 1224 | - """Defines an interface for iterable items which is to assure a uniform | ||
| 1225 | - way to retrieve and iterate items within the git repository. | ||
| 1224 | + """Defines an interface for iterable items, so there is a uniform way to retrieve | ||
| 1225 | + and iterate items within the git repository. | ||
| 1226 | 1226 | ||
| 1227 | 1227 | Subclasses = [Submodule, Commit, Reference, PushInfo, FetchInfo, Remote] | |
| 1228 | 1228 | """ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments