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

Commitc7887c6

Browse files
committed
Improve error handling of fetch/pull line parsing
Fixesgitpython-developers#48
1 parent36cdfd3 commitc7887c6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎git/cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ def dispatch_line(fno):
8383
# we are good ...
8484
line=readline(stream).decode(defenc)
8585
iflineandhandler:
86-
handler(line)
86+
try:
87+
handler(line)
88+
exceptException:
89+
# Keep reading, have to pump the lines empty nontheless
90+
log.error("Line handler exception on line: %s",line,exc_info=True)
91+
# end
8792
returnline
8893
# end dispatch helper
8994
# end

‎git/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def my_progress_handler(line):
518518
raiseGitCommandError(("Error when fetching: %s"%line,),2)
519519
# END handle special messages
520520
forcmdincmds:
521-
ifline[1]==cmd:
521+
iflen(line)>1andline[0]==' 'andline[1]==cmd:
522522
fetch_info_lines.append(line)
523523
continue
524524
# end find command code

‎git/repo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(self, path=None, odbt=DefaultDBType):
113113
:raise NoSuchPathError:
114114
:return: git.Repo """
115115
epath=os.path.abspath(os.path.expandvars(os.path.expanduser(pathoros.getcwd())))
116-
116+
self.git=None# should be set for __del__ not to fail in case we raise
117117
ifnotos.path.exists(epath):
118118
raiseNoSuchPathError(epath)
119119

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp