summaryrefslogtreecommitdiff
path: root/git/index/base.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-03 23:35:55 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-04 02:10:48 +0200
commita469af892b3e929cbe9d29e414b6fcd59bec246e (patch)
treef1ab9ed8946b3be2bb7ed1d3529ad5c0f348f550 /git/index/base.py
parentbe44602b633cfb49a472e192f235ba6de0055d38 (diff)
downloadgitpython-a469af892b3e929cbe9d29e414b6fcd59bec246e.tar.gz
src: No PyDev warnings
+ Mark all unused vars and other non-pep8 (PyDev) warnings + test_utils: + enable & fix forgotten IterableList looped path. + unittestize all assertions. + remote: minor fix progress dispatching unknown err-lines
Diffstat (limited to 'git/index/base.py')
-rw-r--r--git/index/base.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/git/index/base.py b/git/index/base.py
index 9b6d28ab..ac2d3019 100644
--- a/git/index/base.py
+++ b/git/index/base.py
@@ -170,7 +170,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
def _deserialize(self, stream):
"""Initialize this instance with index values read from the given stream"""
- self.version, self.entries, self._extension_data, conten_sha = read_cache(stream)
+ self.version, self.entries, self._extension_data, conten_sha = read_cache(stream) # @UnusedVariable
return self
def _entries_sorted(self):
@@ -404,7 +404,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
continue
# END glob handling
try:
- for root, dirs, files in os.walk(abs_path, onerror=raise_exc):
+ for root, dirs, files in os.walk(abs_path, onerror=raise_exc): # @UnusedVariable
for rela_file in files:
# add relative paths only
yield os.path.join(root.replace(rs, ''), rela_file)
@@ -599,7 +599,6 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
"""Store file at filepath in the database and return the base index entry
Needs the git_working_dir decorator active ! This must be assured in the calling code"""
st = os.lstat(filepath) # handles non-symlinks as well
- stream = None
if S_ISLNK(st.st_mode):
# in PY3, readlink is string, but we need bytes. In PY2, it's just OS encoded bytes, we assume UTF-8
open_stream = lambda: BytesIO(force_bytes(os.readlink(filepath), encoding=defenc))
@@ -1102,11 +1101,11 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
try:
self.entries[(co_path, 0)]
except KeyError:
- dir = co_path
- if not dir.endswith('/'):
- dir += '/'
+ folder = co_path
+ if not folder.endswith('/'):
+ folder += '/'
for entry in mviter(self.entries):
- if entry.path.startswith(dir):
+ if entry.path.startswith(folder):
p = entry.path
self._write_path_to_stdin(proc, p, p, make_exc,
fprogress, read_from_stdout=False)