Skip to content

Commit 1de8af9

Browse files
committed
Removed unnecessary (non-gitpython) tests and fixed flake8
1 parent 6f55c17 commit 1de8af9

File tree

15 files changed

+39
-224
lines changed

15 files changed

+39
-224
lines changed

git/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6+
# flake8: noqa
67

78
import os
89
import sys

git/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
""" Module containing all exceptions thrown througout the git package, """
77

8-
from gitdb.exc import *
8+
from gitdb.exc import * # NOQA
99

1010

1111
class InvalidGitRepositoryError(Exception):

git/index/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Initialize the index package"""
2-
2+
# flake8: noqa
33
from __future__ import absolute_import
44

55
from .base import *

git/objects/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Import all submodules main classes into the package space
33
"""
4+
# flake8: noqa
45
from __future__ import absolute_import
56
import inspect
67
from .base import *

git/objects/blob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class Blob(base.IndexObject):
1717
type = "blob"
1818

1919
# valid blob modes
20-
executable_mode = 0100755
21-
file_mode = 0100644
22-
link_mode = 0120000
20+
executable_mode = 0o100755
21+
file_mode = 0o100644
22+
link_mode = 0o120000
2323

2424
__slots__ = tuple()
2525

git/objects/tree.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
119119
__slots__ = "_cache"
120120

121121
# actual integer ids for comparison
122-
commit_id = 016 # equals stat.S_IFDIR | stat.S_IFLNK - a directory link
123-
blob_id = 010
124-
symlink_id = 012
125-
tree_id = 004
122+
commit_id = 0o16 # equals stat.S_IFDIR | stat.S_IFLNK - a directory link
123+
blob_id = 0o10
124+
symlink_id = 0o12
125+
tree_id = 0o04
126126

127127
_map_id_to_type = {
128128
commit_id: Submodule,

git/refs/__init__.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
# flake8: noqa
22
from __future__ import absolute_import
33
# import all modules in order, fix the names they require
44
from .symbolic import *
@@ -7,16 +7,4 @@
77
from .tag import *
88
from .remote import *
99

10-
# name fixes
11-
from . import head
12-
head.RemoteReference = RemoteReference
13-
del(head)
14-
15-
16-
from . import symbolic
17-
for item in (HEAD, Head, RemoteReference, TagReference, Reference, SymbolicReference):
18-
setattr(symbolic, item.__name__, item)
19-
del(symbolic)
20-
21-
2210
from .log import *

git/refs/head.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def reset(self, commit='HEAD', index=True, working_tree=False,
8181

8282
try:
8383
self.repo.git.reset(mode, commit, add_arg, paths, **kwargs)
84-
except GitCommandError, e:
84+
except GitCommandError as e:
8585
# git nowadays may use 1 as status to indicate there are still unstaged
8686
# modifications after the reset
8787
if e.status != 1:
@@ -134,6 +134,7 @@ def set_tracking_branch(self, remote_reference):
134134
:param remote_reference: The remote reference to track or None to untrack
135135
any references
136136
:return: self"""
137+
from .remote import RemoteReference
137138
if remote_reference is not None and not isinstance(remote_reference, RemoteReference):
138139
raise ValueError("Incorrect parameter type: %r" % remote_reference)
139140
# END handle type
@@ -156,6 +157,7 @@ def tracking_branch(self):
156157
"""
157158
:return: The remote_reference we are tracking, or None if we are
158159
not a tracking branch"""
160+
from .remote import RemoteReference
159161
reader = self.config_reader()
160162
if reader.has_option(self.k_config_remote) and reader.has_option(self.k_config_remote_ref):
161163
ref = Head(self.repo, Head.to_full_path(reader.get_value(self.k_config_remote_ref)))

git/refs/symbolic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ def from_path(cls, repo, path):
625625

626626
# Names like HEAD are inserted after the refs module is imported - we have an import dependency
627627
# cycle and don't want to import these names in-function
628+
from . import HEAD, Head, RemoteReference, TagReference, Reference
628629
for ref_type in (HEAD, Head, RemoteReference, TagReference, Reference, SymbolicReference):
629630
try:
630631
instance = ref_type(repo, path)

git/repo/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"""Initialize the Repo package"""
2+
# flake8: noqa
23
from __future__ import absolute_import
34
from .base import *

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy