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

Commit8a01ec4

Browse files
committed
FIX config-lock release early regression caused by#519
+ Regression introduced ind84b960, by a wrong commentinterpretation.
1 parentf48ef31 commit8a01ec4

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

‎git/config.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -479,20 +479,15 @@ def write(self):
479479
is_file_lock=isinstance(fp,string_types+ (FileType, ))
480480
ifis_file_lock:
481481
self._lock._obtain_lock()
482-
try:
483-
ifnothasattr(fp,"seek"):
484-
withopen(self._file_or_files,"wb")asfp:
485-
self._write(fp)
486-
else:
487-
fp.seek(0)
488-
# make sure we do not overwrite into an existing file
489-
ifhasattr(fp,'truncate'):
490-
fp.truncate()
482+
ifnothasattr(fp,"seek"):
483+
withopen(self._file_or_files,"wb")asfp:
491484
self._write(fp)
492-
finally:
493-
# we release the lock - it will not vanish automatically in PY3.5+
494-
ifis_file_lock:
495-
self._lock._release_lock()
485+
else:
486+
fp.seek(0)
487+
# make sure we do not overwrite into an existing file
488+
ifhasattr(fp,'truncate'):
489+
fp.truncate()
490+
self._write(fp)
496491

497492
def_assure_writable(self,method_name):
498493
ifself.read_only:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp