| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,10 @@ | |||
| 1 | 1 | # UNUSED, only for reference. If adjustments are needed, please see github actions | |
| 2 | 2 | language: python | |
| 3 | 3 | python: | |
| 4 | + <<<<<<< HEAD | ||
| 4 | 5 | - "3.4" | |
| 6 | + ======= | ||
| 7 | + >>>>>>> b0f79c58ad919e90261d1e332df79a4ad0bc40de | ||
| 5 | 8 | - "3.6" | |
| 6 | 9 | - "3.7" | |
| 7 | 10 | - "3.8" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,4 +43,5 @@ Contributors are: | |||
| 43 | 43 | -Liam Beguin <liambeguin _at_ gmail.com> | |
| 44 | 44 | -Ram Rachum <ram _at_ rachum.com> | |
| 45 | 45 | -Alba Mendez <me _at_ alba.sh> | |
| 46 | + -Robert Westman <robert _at_ byteflux.io> | ||
| 46 | 47 | Portions derived from other open source works and are clearly marked. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1 +1 @@ | |||
| 1 | - 3.1.17 | ||
| 1 | + 3.1.18 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,14 @@ | |||
| 2 | 2 | Changelog | |
| 3 | 3 | ========= | |
| 4 | 4 | ||
| 5 | + 3.1.18 | ||
| 6 | + ====== | ||
| 7 | + | ||
| 8 | + * drop support for python 3.5 to reduce maintenance burden on typing. Lower patch levels of python 3.5 would break, too. | ||
| 9 | + | ||
| 10 | + See the following for details: | ||
| 11 | + https://github.com/gitpython-developers/gitpython/milestone/50?closed=1 | ||
| 12 | + | ||
| 5 | 13 | 3.1.17 | |
| 6 | 14 | ====== | |
| 7 | 15 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,9 +17,7 @@ | |||
| 17 | 17 | import subprocess | |
| 18 | 18 | import sys | |
| 19 | 19 | import threading | |
| 20 | - from collections import OrderedDict | ||
| 21 | 20 | from textwrap import dedent | |
| 22 | - import warnings | ||
| 23 | 21 | ||
| 24 | 22 | from git.compat import ( | |
| 25 | 23 | defenc, | |
@@ -1004,13 +1002,6 @@ def transform_kwarg(self, name: str, value: Any, split_single_char_options: bool | |||
| 1004 | 1002 | ||
| 1005 | 1003 | def transform_kwargs(self, split_single_char_options: bool = True, **kwargs: Any) -> List[str]: | |
| 1006 | 1004 | """Transforms Python style kwargs into git command line options.""" | |
| 1007 | - # Python 3.6 preserves the order of kwargs and thus has a stable | ||
| 1008 | - # order. For older versions sort the kwargs by the key to get a stable | ||
| 1009 | - # order. | ||
| 1010 | - if sys.version_info[:2] < (3, 6): | ||
| 1011 | - kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) | ||
| 1012 | - warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" + | ||
| 1013 | - "It does not preserve the order for key-word arguments and enforce lexical sorting instead.") | ||
| 1014 | 1005 | args = [] | |
| 1015 | 1006 | for k, v in kwargs.items(): | |
| 1016 | 1007 | if isinstance(v, (list, tuple)): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,6 +11,7 @@ | |||
| 11 | 11 | S_ISDIR, | |
| 12 | 12 | S_IFMT, | |
| 13 | 13 | S_IFREG, | |
| 14 | + S_IXUSR, | ||
| 14 | 15 | ) | |
| 15 | 16 | import subprocess | |
| 16 | 17 | ||
@@ -115,7 +116,7 @@ def stat_mode_to_index_mode(mode: int) -> int: | |||
| 115 | 116 | return S_IFLNK | |
| 116 | 117 | if S_ISDIR(mode) or S_IFMT(mode) == S_IFGITLINK: # submodules | |
| 117 | 118 | return S_IFGITLINK | |
| 118 | - return S_IFREG | 0o644 | (mode & 0o111) # blobs with or without executable bit | ||
| 119 | + return S_IFREG | (mode & S_IXUSR and 0o755 or 0o644) # blobs with or without executable bit | ||
| 119 | 120 | ||
| 120 | 121 | ||
| 121 | 122 | def write_cache(entries: Sequence[Union[BaseIndexEntry, 'IndexEntry']], stream: IO[bytes], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,8 @@ class TagReference(Reference): | |||
| 18 | 18 | print(tagref.tag.message)""" | |
| 19 | 19 | ||
| 20 | 20 | __slots__ = () | |
| 21 | - _common_path_default = "refs/tags" | ||
| 21 | + _common_default = "tags" | ||
| 22 | + _common_path_default = Reference._common_path_default + "/" + _common_default | ||
| 22 | 23 | ||
| 23 | 24 | @property | |
| 24 | 25 | def commit(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -612,7 +612,7 @@ def stale_refs(self) -> IterableList: | |||
| 612 | 612 | # * [would prune] origin/new_branch | |
| 613 | 613 | token = " * [would prune] " | |
| 614 | 614 | if not line.startswith(token): | |
| 615 | - raise ValueError("Could not parse git-remote prune result: %r" % line) | ||
| 615 | + continue | ||
| 616 | 616 | ref_name = line.replace(token, "") | |
| 617 | 617 | # sometimes, paths start with a full ref name, like refs/tags/foo, see #260 | |
| 618 | 618 | if ref_name.startswith(Reference._common_path_default + '/'): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,12 +3,13 @@ | |||
| 3 | 3 | # | |
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | - | ||
| 7 | 6 | import logging | |
| 8 | 7 | import os | |
| 9 | 8 | import re | |
| 10 | 9 | import warnings | |
| 11 | 10 | ||
| 11 | + from gitdb.exc import BadObject | ||
| 12 | + | ||
| 12 | 13 | from git.cmd import ( | |
| 13 | 14 | Git, | |
| 14 | 15 | handle_process_output | |
@@ -402,7 +403,17 @@ def tags(self) -> 'IterableList': | |||
| 402 | 403 | def tag(self, path: PathLike) -> TagReference: | |
| 403 | 404 | """:return: TagReference Object, reference pointing to a Commit or Tag | |
| 404 | 405 | :param path: path to the tag reference, i.e. 0.1.5 or tags/0.1.5 """ | |
| 405 | - return TagReference(self, path) | ||
| 406 | + full_path = self._to_full_tag_path(path) | ||
| 407 | + return TagReference(self, full_path) | ||
| 408 | + | ||
| 409 | + @staticmethod | ||
| 410 | + def _to_full_tag_path(path): | ||
| 411 | + if path.startswith(TagReference._common_path_default + '/'): | ||
| 412 | + return path | ||
| 413 | + if path.startswith(TagReference._common_default + '/'): | ||
| 414 | + return Reference._common_path_default + '/' + path | ||
| 415 | + else: | ||
| 416 | + return TagReference._common_path_default + '/' + path | ||
| 406 | 417 | ||
| 407 | 418 | def create_head(self, path: PathLike, commit: str = 'HEAD', | |
| 408 | 419 | force: bool = False, logmsg: Optional[str] = None | |
@@ -608,6 +619,23 @@ def is_ancestor(self, ancestor_rev: 'Commit', rev: 'Commit') -> bool: | |||
| 608 | 619 | raise | |
| 609 | 620 | return True | |
| 610 | 621 | ||
| 622 | + def is_valid_object(self, sha: str, object_type: str = None) -> bool: | ||
| 623 | + try: | ||
| 624 | + complete_sha = self.odb.partial_to_complete_sha_hex(sha) | ||
| 625 | + object_info = self.odb.info(complete_sha) | ||
| 626 | + if object_type: | ||
| 627 | + if object_info.type == object_type.encode(): | ||
| 628 | + return True | ||
| 629 | + else: | ||
| 630 | + log.debug("Commit hash points to an object of type '%s'. Requested were objects of type '%s'", | ||
| 631 | + object_info.type.decode(), object_type) | ||
| 632 | + return False | ||
| 633 | + else: | ||
| 634 | + return True | ||
| 635 | + except BadObject: | ||
| 636 | + log.debug("Commit hash is invalid.") | ||
| 637 | + return False | ||
| 638 | + | ||
| 611 | 639 | def _get_daemon_export(self) -> bool: | |
| 612 | 640 | if self.git_dir: | |
| 613 | 641 | filename = osp.join(self.git_dir, self.DAEMON_EXPORT_FILE) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -470,7 +470,7 @@ def _parse_progress_line(self, line: AnyStr) -> None: | |||
| 470 | 470 | line_str = line | |
| 471 | 471 | self._cur_line = line_str | |
| 472 | 472 | ||
| 473 | - if self.error_lines or self._cur_line.startswith(('error:', 'fatal:')): | ||
| 473 | + if self._cur_line.startswith(('error:', 'fatal:')): | ||
| 474 | 474 | self.error_lines.append(self._cur_line) | |
| 475 | 475 | return | |
| 476 | 476 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments