Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1de8af9

Browse files
committed
Removed unnecessary (non-gitpython) tests and fixed flake8
1 parent6f55c17 commit1de8af9

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
importos
89
importsys

‎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-
fromgitdb.excimport*
8+
fromgitdb.excimport*# NOQA
99

1010

1111
classInvalidGitRepositoryError(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__importabsolute_import
44

55
from .baseimport*

‎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__importabsolute_import
56
importinspect
67
from .baseimport*

‎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__importabsolute_import
33
# import all modules in order, fix the names they require
44
from .symbolicimport*
@@ -7,16 +7,4 @@
77
from .tagimport*
88
from .remoteimport*
99

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

‎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-
exceptGitCommandError,e:
84+
exceptGitCommandErrorase:
8585
# git nowadays may use 1 as status to indicate there are still unstaged
8686
# modifications after the reset
8787
ife.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 .remoteimportRemoteReference
137138
ifremote_referenceisnotNoneandnotisinstance(remote_reference,RemoteReference):
138139
raiseValueError("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 .remoteimportRemoteReference
159161
reader=self.config_reader()
160162
ifreader.has_option(self.k_config_remote)andreader.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 .importHEAD,Head,RemoteReference,TagReference,Reference
628629
forref_typein (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__importabsolute_import
34
from .baseimport*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp