Skip to content

Report actual attempted Git command when Git.refresh fails #1812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 26, 2024
Prev Previous commit
Next Next commit
Refactor _rollback_refresh slightly for clarity
  • Loading branch information
EliahKagan committed Jan 25, 2024
commit ae28c986310703a83d0e2495e0e50530231040ee
3 changes: 1 addition & 2 deletions test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ def _patch_out_env(name):

@contextlib.contextmanager
def _rollback_refresh():
old_git_executable = Git.GIT_PYTHON_GIT_EXECUTABLE
try:
yield old_git_executable # Let test code run that may mutate class state.
yield Git.GIT_PYTHON_GIT_EXECUTABLE # Provide the old value for convenience.
finally:
refresh()

Expand Down