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

Commit8942284

Browse files
committed
index: Fixed bug which caused incorrect separators in output files of the return value
remote: fixed evil bug that was caused by some inconsistency of python when __getattr__ and __slots__ are invovled - namely it calles getattr before checking for a slot of the same name, in an alternating fashion
1 parent3d93100 commit8942284

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎lib/git/index/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,14 +1021,14 @@ def handle_stderr(proc, iter_checked_out_files):
10211021
checked_out_files=list()
10221022

10231023
forpathinpaths:
1024-
path=self._to_relative_path(path)
1024+
co_path=to_native_path_linux(self._to_relative_path(path))
10251025
# if the item is not in the index, it could be a directory
10261026
path_is_directory=False
10271027

10281028
try:
1029-
self.entries[(path,0)]
1029+
self.entries[(co_path,0)]
10301030
exceptKeyError:
1031-
dir=path
1031+
dir=co_path
10321032
ifnotdir.endswith('/'):
10331033
dir+='/'
10341034
forentryinself.entries.itervalues():
@@ -1043,9 +1043,9 @@ def handle_stderr(proc, iter_checked_out_files):
10431043
# END path exception handlnig
10441044

10451045
ifnotpath_is_directory:
1046-
self._write_path_to_stdin(proc,path,path,make_exc,
1046+
self._write_path_to_stdin(proc,co_path,path,make_exc,
10471047
fprogress,read_from_stdout=False)
1048-
checked_out_files.append(path)
1048+
checked_out_files.append(co_path)
10491049
# END path is a file
10501050
# END for each path
10511051
self._flush_stdin_and_wait(proc,ignore_stdout=True)

‎lib/git/remote.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
fromexcimportGitCommandError
99
fromobjectsimportCommit
10+
fromConfigParserimportNoOptionError
1011

1112
fromgit.utilimport (
1213
LazyMixin,
@@ -435,7 +436,13 @@ def __getattr__(self, attr):
435436
ifattr=="_config_reader":
436437
returnsuper(Remote,self).__getattr__(attr)
437438

438-
returnself._config_reader.get(attr)
439+
# sometimes, probably due to a bug in python itself, we are being called
440+
# even though a slot of the same name exists
441+
try:
442+
returnself._config_reader.get(attr)
443+
exceptNoOptionError:
444+
returnsuper(Remote,self).__getattr__(attr)
445+
# END handle exception
439446

440447
def_config_section_name(self):
441448
return'remote "%s"'%self.name

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp