| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e0e5918 commit afe3ac9
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,14 +183,6 @@ | |||
| 183 | 183 | "lineCount": 1 | |
| 184 | 184 | } | |
| 185 | 185 | }, | |
| 186 | - { | ||
| 187 | - "code": "reportPossiblyUnboundVariable", | ||
| 188 | - "range": { | ||
| 189 | - "startColumn": 52, | ||
| 190 | - "endColumn": 59, | ||
| 191 | - "lineCount": 1 | ||
| 192 | - } | ||
| 193 | - }, | ||
| 194 | 186 | { | |
| 195 | 187 | "code": "reportSelfClsParameterName", | |
| 196 | 188 | "range": { | |
@@ -207,14 +199,6 @@ | |||
| 207 | 199 | "lineCount": 1 | |
| 208 | 200 | } | |
| 209 | 201 | }, | |
| 210 | - { | ||
| 211 | - "code": "reportPossiblyUnboundVariable", | ||
| 212 | - "range": { | ||
| 213 | - "startColumn": 41, | ||
| 214 | - "endColumn": 44, | ||
| 215 | - "lineCount": 1 | ||
| 216 | - } | ||
| 217 | - }, | ||
| 218 | 202 | { | |
| 219 | 203 | "code": "reportArgumentType", | |
| 220 | 204 | "range": { | |
@@ -393,14 +377,6 @@ | |||
| 393 | 377 | "lineCount": 1 | |
| 394 | 378 | } | |
| 395 | 379 | }, | |
| 396 | - { | ||
| 397 | - "code": "reportPossiblyUnboundVariable", | ||
| 398 | - "range": { | ||
| 399 | - "startColumn": 19, | ||
| 400 | - "endColumn": 25, | ||
| 401 | - "lineCount": 1 | ||
| 402 | - } | ||
| 403 | - }, | ||
| 404 | 380 | { | |
| 405 | 381 | "code": "reportArgumentType", | |
| 406 | 382 | "range": { | |
@@ -467,30 +443,6 @@ | |||
| 467 | 443 | "lineCount": 1 | |
| 468 | 444 | } | |
| 469 | 445 | }, | |
| 470 | - { | ||
| 471 | - "code": "reportPossiblyUnboundVariable", | ||
| 472 | - "range": { | ||
| 473 | - "startColumn": 23, | ||
| 474 | - "endColumn": 34, | ||
| 475 | - "lineCount": 1 | ||
| 476 | - } | ||
| 477 | - }, | ||
| 478 | - { | ||
| 479 | - "code": "reportPossiblyUnboundVariable", | ||
| 480 | - "range": { | ||
| 481 | - "startColumn": 32, | ||
| 482 | - "endColumn": 43, | ||
| 483 | - "lineCount": 1 | ||
| 484 | - } | ||
| 485 | - }, | ||
| 486 | - { | ||
| 487 | - "code": "reportPossiblyUnboundVariable", | ||
| 488 | - "range": { | ||
| 489 | - "startColumn": 23, | ||
| 490 | - "endColumn": 34, | ||
| 491 | - "lineCount": 1 | ||
| 492 | - } | ||
| 493 | - }, | ||
| 494 | 446 | { | |
| 495 | 447 | "code": "reportArgumentType", | |
| 496 | 448 | "range": { | |
@@ -499,14 +451,6 @@ | |||
| 499 | 451 | "lineCount": 1 | |
| 500 | 452 | } | |
| 501 | 453 | }, | |
| 502 | - { | ||
| 503 | - "code": "reportPossiblyUnboundVariable", | ||
| 504 | - "range": { | ||
| 505 | - "startColumn": 28, | ||
| 506 | - "endColumn": 32, | ||
| 507 | - "lineCount": 1 | ||
| 508 | - } | ||
| 509 | - }, | ||
| 510 | 454 | { | |
| 511 | 455 | "code": "reportAttributeAccessIssue", | |
| 512 | 456 | "range": { | |
@@ -588,16 +532,6 @@ | |||
| 588 | 532 | } | |
| 589 | 533 | } | |
| 590 | 534 | ], | |
| 591 | - "./git/objects/submodule/root.py": [ | ||
| 592 | - { | ||
| 593 | - "code": "reportPossiblyUnboundVariable", | ||
| 594 | - "range": { | ||
| 595 | - "startColumn": 18, | ||
| 596 | - "endColumn": 21, | ||
| 597 | - "lineCount": 1 | ||
| 598 | - } | ||
| 599 | - } | ||
| 600 | - ], | ||
| 601 | 535 | "./git/objects/tag.py": [ | |
| 602 | 536 | { | |
| 603 | 537 | "code": "reportIncompatibleVariableOverride", | |
@@ -701,14 +635,6 @@ | |||
| 701 | 635 | "lineCount": 1 | |
| 702 | 636 | } | |
| 703 | 637 | }, | |
| 704 | - { | ||
| 705 | - "code": "reportPossiblyUnboundVariable", | ||
| 706 | - "range": { | ||
| 707 | - "startColumn": 41, | ||
| 708 | - "endColumn": 45, | ||
| 709 | - "lineCount": 1 | ||
| 710 | - } | ||
| 711 | - }, | ||
| 712 | 638 | { | |
| 713 | 639 | "code": "reportArgumentType", | |
| 714 | 640 | "range": { | |
@@ -855,38 +781,6 @@ | |||
| 855 | 781 | "lineCount": 1 | |
| 856 | 782 | } | |
| 857 | 783 | }, | |
| 858 | - { | ||
| 859 | - "code": "reportPossiblyUnboundVariable", | ||
| 860 | - "range": { | ||
| 861 | - "startColumn": 26, | ||
| 862 | - "endColumn": 34, | ||
| 863 | - "lineCount": 1 | ||
| 864 | - } | ||
| 865 | - }, | ||
| 866 | - { | ||
| 867 | - "code": "reportPossiblyUnboundVariable", | ||
| 868 | - "range": { | ||
| 869 | - "startColumn": 32, | ||
| 870 | - "endColumn": 40, | ||
| 871 | - "lineCount": 1 | ||
| 872 | - } | ||
| 873 | - }, | ||
| 874 | - { | ||
| 875 | - "code": "reportPossiblyUnboundVariable", | ||
| 876 | - "range": { | ||
| 877 | - "startColumn": 18, | ||
| 878 | - "endColumn": 26, | ||
| 879 | - "lineCount": 1 | ||
| 880 | - } | ||
| 881 | - }, | ||
| 882 | - { | ||
| 883 | - "code": "reportPossiblyUnboundVariable", | ||
| 884 | - "range": { | ||
| 885 | - "startColumn": 22, | ||
| 886 | - "endColumn": 30, | ||
| 887 | - "lineCount": 1 | ||
| 888 | - } | ||
| 889 | - }, | ||
| 890 | 784 | { | |
| 891 | 785 | "code": "reportReturnType", | |
| 892 | 786 | "range": { | |
@@ -967,22 +861,6 @@ | |||
| 967 | 861 | "lineCount": 1 | |
| 968 | 862 | } | |
| 969 | 863 | }, | |
| 970 | - { | ||
| 971 | - "code": "reportPossiblyUnboundVariable", | ||
| 972 | - "range": { | ||
| 973 | - "startColumn": 39, | ||
| 974 | - "endColumn": 47, | ||
| 975 | - "lineCount": 1 | ||
| 976 | - } | ||
| 977 | - }, | ||
| 978 | - { | ||
| 979 | - "code": "reportPossiblyUnboundVariable", | ||
| 980 | - "range": { | ||
| 981 | - "startColumn": 43, | ||
| 982 | - "endColumn": 51, | ||
| 983 | - "lineCount": 1 | ||
| 984 | - } | ||
| 985 | - }, | ||
| 986 | 864 | { | |
| 987 | 865 | "code": "reportArgumentType", | |
| 988 | 866 | "range": { | |
@@ -998,22 +876,6 @@ | |||
| 998 | 876 | "endColumn": 38, | |
| 999 | 877 | "lineCount": 1 | |
| 1000 | 878 | } | |
| 1001 | - }, | ||
| 1002 | - { | ||
| 1003 | - "code": "reportPossiblyUnboundVariable", | ||
| 1004 | - "range": { | ||
| 1005 | - "startColumn": 26, | ||
| 1006 | - "endColumn": 42, | ||
| 1007 | - "lineCount": 1 | ||
| 1008 | - } | ||
| 1009 | - }, | ||
| 1010 | - { | ||
| 1011 | - "code": "reportPossiblyUnboundVariable", | ||
| 1012 | - "range": { | ||
| 1013 | - "startColumn": 18, | ||
| 1014 | - "endColumn": 34, | ||
| 1015 | - "lineCount": 1 | ||
| 1016 | - } | ||
| 1017 | 879 | } | |
| 1018 | 880 | ], | |
| 1019 | 881 | "./git/repo/fun.py": [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -730,14 +730,17 @@ def _entries_for_paths( | |||
| 730 | 730 | ) -> List[BaseIndexEntry]: | |
| 731 | 731 | entries_added: List[BaseIndexEntry] = [] | |
| 732 | 732 | if path_rewriter: | |
| 733 | + working_tree_dir = self.repo.working_tree_dir | ||
| 734 | + if working_tree_dir is None: | ||
| 735 | + raise InvalidGitRepositoryError("Cannot rewrite paths without a working tree") | ||
| 736 | + working_tree_dir = str(working_tree_dir) | ||
| 733 | 737 | for path in paths: | |
| 734 | 738 | if osp.isabs(path): | |
| 735 | 739 | abspath = path | |
| 736 | - gitrelative_path = path[len(str(self.repo.working_tree_dir)) + 1 :] | ||
| 740 | + gitrelative_path = path[len(working_tree_dir) + 1 :] | ||
| 737 | 741 | else: | |
| 738 | 742 | gitrelative_path = path | |
| 739 | - if self.repo.working_tree_dir: | ||
| 740 | - abspath = osp.join(self.repo.working_tree_dir, gitrelative_path) | ||
| 743 | + abspath = osp.join(working_tree_dir, gitrelative_path) | ||
| 741 | 744 | # END obtain relative and absolute paths | |
| 742 | 745 | ||
| 743 | 746 | blob = Blob( | |
@@ -1467,8 +1470,8 @@ def reset( | |||
| 1467 | 1470 | nie = new_inst.entries | |
| 1468 | 1471 | for path in paths: | |
| 1469 | 1472 | path = self._to_relative_path(path) | |
| 1473 | + key = entry_key(path, 0) | ||
| 1470 | 1474 | try: | |
| 1471 | - key = entry_key(path, 0) | ||
| 1472 | 1475 | self.entries[key] = nie[key] | |
| 1473 | 1476 | except KeyError: | |
| 1474 | 1477 | # If key is not in theirs, it mustn't be in ours. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -877,6 +877,7 @@ def fetch_remotes(module_repo: "Repo") -> None: | |||
| 877 | 877 | ############################# | |
| 878 | 878 | binsha = self.binsha | |
| 879 | 879 | hexsha = self.hexsha | |
| 880 | + is_detached = False | ||
| 880 | 881 | if mrepo is not None: | |
| 881 | 882 | # mrepo is only set if we are not in dry-run mode or if the module | |
| 882 | 883 | # existed. | |
@@ -1221,6 +1222,7 @@ def remove( | |||
| 1221 | 1222 | for remote in mod.remotes: | |
| 1222 | 1223 | num_branches_with_new_commits = 0 | |
| 1223 | 1224 | rrefs = remote.refs | |
| 1225 | + rref = None | ||
| 1224 | 1226 | for rref in rrefs: | |
| 1225 | 1227 | num_branches_with_new_commits += len(mod.git.cherry(rref)) != 0 | |
| 1226 | 1228 | # END for each remote ref | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -269,6 +269,7 @@ def entry_at(cls, filepath: PathLike, index: int) -> "RefLogEntry": | |||
| 269 | 269 | return RefLogEntry.from_line(fp.readlines()[index].strip()) | |
| 270 | 270 | # Read until index is reached. | |
| 271 | 271 | ||
| 272 | + line = b"" | ||
| 272 | 273 | for i in range(index + 1): | |
| 273 | 274 | line = fp.readline() | |
| 274 | 275 | if not line: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -933,13 +933,17 @@ def is_valid_object(self, sha: str, object_type: Union[str, None] = None) -> boo | |||
| 933 | 933 | return False | |
| 934 | 934 | ||
| 935 | 935 | def _get_daemon_export(self) -> bool: | |
| 936 | - if self.git_dir: | ||
| 937 | - filename = osp.join(self.git_dir, self.DAEMON_EXPORT_FILE) | ||
| 936 | + git_dir = getattr(self, "git_dir", None) | ||
| 937 | + if git_dir is None: | ||
| 938 | + return False | ||
| 939 | + filename = osp.join(git_dir, self.DAEMON_EXPORT_FILE) | ||
| 938 | 940 | return osp.exists(filename) | |
| 939 | 941 | ||
| 940 | 942 | def _set_daemon_export(self, value: object) -> None: | |
| 941 | - if self.git_dir: | ||
| 942 | - filename = osp.join(self.git_dir, self.DAEMON_EXPORT_FILE) | ||
| 943 | + git_dir = getattr(self, "git_dir", None) | ||
| 944 | + if git_dir is None: | ||
| 945 | + return | ||
| 946 | + filename = osp.join(git_dir, self.DAEMON_EXPORT_FILE) | ||
| 943 | 947 | fileexists = osp.exists(filename) | |
| 944 | 948 | if value and not fileexists: | |
| 945 | 949 | touch(filename) | |
@@ -1279,6 +1283,7 @@ class InfoTD(TypedDict, total=False): | |||
| 1279 | 1283 | ||
| 1280 | 1284 | keepends = True | |
| 1281 | 1285 | for line_bytes in data.splitlines(keepends): | |
| 1286 | + line_str = "" | ||
| 1282 | 1287 | try: | |
| 1283 | 1288 | line_str = line_bytes.rstrip().decode(defenc) | |
| 1284 | 1289 | except UnicodeDecodeError: | |
@@ -1737,8 +1742,9 @@ def currently_rebasing_on(self) -> Commit | None: | |||
| 1737 | 1742 | ||
| 1738 | 1743 | ``None`` if we are not currently rebasing. | |
| 1739 | 1744 | """ | |
| 1740 | - if self.git_dir: | ||
| 1741 | - rebase_head_file = osp.join(self.git_dir, "REBASE_HEAD") | ||
| 1745 | + if not self.git_dir: | ||
| 1746 | + return None | ||
| 1747 | + rebase_head_file = osp.join(self.git_dir, "REBASE_HEAD") | ||
| 1742 | 1748 | if not osp.isfile(rebase_head_file): | |
| 1743 | 1749 | return None | |
| 1744 | 1750 | with open(rebase_head_file, "rt") as f: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -337,6 +337,12 @@ def test_daemon_export(self): | |||
| 337 | 337 | self.rorepo.daemon_export = orig_val | |
| 338 | 338 | self.assertEqual(self.rorepo.daemon_export, orig_val) | |
| 339 | 339 | ||
| 340 | + def test_daemon_export_without_git_dir(self): | ||
| 341 | + repo = Repo.__new__(Repo) | ||
| 342 | + repo.git_dir = None | ||
| 343 | + self.assertFalse(repo._get_daemon_export()) | ||
| 344 | + repo._set_daemon_export(True) | ||
| 345 | + | ||
| 340 | 346 | def test_alternates(self): | |
| 341 | 347 | cur_alternates = self.rorepo.alternates | |
| 342 | 348 | try: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments