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

Commit5eb8289

Browse files
committed
fix Loop variable used outside the loop
1 parent607d8aa commit5eb8289

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

‎git/diff.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,14 @@ def _index_from_patch_format(cls, repo, proc):
415415
text=b''.join(text)
416416
index=DiffIndex()
417417
previous_header=None
418-
forheaderincls.re_header.finditer(text):
418+
header=None
419+
for_headerincls.re_header.finditer(text):
419420
a_path_fallback,b_path_fallback, \
420421
old_mode,new_mode, \
421422
rename_from,rename_to, \
422423
new_file_mode,deleted_file_mode, \
423424
a_blob_id,b_blob_id,b_mode, \
424-
a_path,b_path=header.groups()
425+
a_path,b_path=_header.groups()
425426

426427
new_file,deleted_file=bool(new_file_mode),bool(deleted_file_mode)
427428

@@ -431,7 +432,7 @@ def _index_from_patch_format(cls, repo, proc):
431432
# Our only means to find the actual text is to see what has not been matched by our regex,
432433
# and then retro-actively assign it to our index
433434
ifprevious_headerisnotNone:
434-
index[-1].diff=text[previous_header.end():header.start()]
435+
index[-1].diff=text[previous_header.end():_header.start()]
435436
# end assign actual diff
436437

437438
# Make sure the mode is set if the path is set. Otherwise the resulting blob is invalid
@@ -450,7 +451,8 @@ def _index_from_patch_format(cls, repo, proc):
450451
rename_to,
451452
None,None,None))
452453

453-
previous_header=header
454+
previous_header=_header
455+
header=_header
454456
# end for each header we parse
455457
ifindex:
456458
index[-1].diff=text[header.end():]

‎git/objects/submodule/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False):
846846
# have to manually delete references as python's scoping is
847847
# not existing, they could keep handles open ( on windows this is a problem )
848848
iflen(rrefs):
849-
del(rref)
849+
del(rref)# skipcq:PYL-W0631
850850
# END handle remotes
851851
del(rrefs)
852852
del(remote)

‎git/refs/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def entry_at(cls, filepath, index):
228228
# END abort on eof
229229
# END handle runup
230230

231-
ifi!=indexornotline:
231+
ifi!=indexornotline:# skipcq:PYL-W0631
232232
raiseIndexError
233233
# END handle exception
234234

‎git/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def join_path(a, *p):
133133
'/' instead of possibly '\' on windows."""
134134
path=a
135135
forbinp:
136-
iflen(b)==0:
136+
ifnotb:
137137
continue
138138
ifb.startswith('/'):
139139
path+=b[1:]
@@ -386,7 +386,7 @@ def _parse_progress_line(self, line):
386386
# Compressing objects: 100% (2/2)
387387
# Compressing objects: 100% (2/2), done.
388388
self._cur_line=line=line.decode('utf-8')ifisinstance(line,bytes)elseline
389-
iflen(self.error_lines)>0orself._cur_line.startswith(('error:','fatal:')):
389+
ifself.error_linesorself._cur_line.startswith(('error:','fatal:')):
390390
self.error_lines.append(self._cur_line)
391391
return
392392

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp