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

Commit82b0a1e

Browse files
committed
Clarify comments; add assertion (helps mypy)
1 parent24b065e commit82b0a1e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎git/cmd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,11 @@ def version_info(self) -> Tuple[int, int, int, int]:
838838
839839
This value is generated on demand and is cached.
840840
"""
841-
refresh_token=self._refresh_token# Copy it, in case of a concurrent refresh.
841+
# Use a copy of this global state, in case of a concurrent refresh.
842+
refresh_token=self._refresh_token
842843

843844
# Ask git for its version if we haven't done so since the last refresh.
844-
# (Refreshing is global, butversion information caching is per-instance.)
845+
# (Refreshing is global, butversion_info caching is per-instance.)
845846
ifself._version_info_tokenisnotrefresh_token:
846847
# We only use the first 4 numbers, as everything else could be strings in fact (on Windows).
847848
process_version=self._call_process("version")# Should be as default *args and **kwargs used.
@@ -853,6 +854,7 @@ def version_info(self) -> Tuple[int, int, int, int]:
853854
)
854855
self._version_info_token=refresh_token
855856

857+
assertself._version_infoisnotNone,"Bug: token check should never let None through"
856858
returnself._version_info
857859

858860
@overload

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp