blog entry
Deploy production / deploy (push) Successful in 46s

This commit is contained in:
2026-08-13 19:22:21 -07:00
parent c0cbdac8af
commit 034c1b653e
4 changed files with 148 additions and 8 deletions
+36 -3
View File
@@ -9,7 +9,12 @@ import sys
import threading
from typing import Callable
from git_repo import GitRepository, GitRepositoryError, RepositoryState
from git_repo import (
GitAuthenticationError,
GitRepository,
GitRepositoryError,
RepositoryState,
)
SCRIPT_DIR = Path(__file__).resolve().parent
@@ -125,9 +130,8 @@ def run_gui() -> None:
def refresh(self) -> None:
def operation() -> RepositoryState:
repository = GitRepository.locate(SCRIPT_DIR)
state = repository.refresh()
self.repository = repository
return state
return repository.refresh()
self._start_git_task("Refreshing repository status", operation)
@@ -209,6 +213,8 @@ def run_gui() -> None:
def worker() -> None:
try:
state = operation()
except GitAuthenticationError as exc:
self.root.after(0, self._finish_authentication_error, label, str(exc))
except (GitRepositoryError, OSError) as exc:
self.root.after(0, self._finish_error, label, str(exc))
else:
@@ -216,6 +222,33 @@ def run_gui() -> None:
threading.Thread(target=worker, daemon=True).start()
def _finish_authentication_error(self, label: str, detail: str) -> None:
self.busy = False
self.state = None
self.details_var.set(detail)
self.values["status"].set("Authentication required")
self._update_buttons()
if self.repository is None:
messagebox.showerror(label, detail, parent=self.root)
return
retry = messagebox.askyesno(
"Git authentication failed",
f"{detail}\n\n"
"Clear only the saved credential for this repository's HTTPS host "
"and open the Git Credential Manager sign-in flow?\n\n"
"Working files and local commits will not be changed.",
parent=self.root,
)
if not retry:
return
repository = self.repository
def clear_and_refresh() -> RepositoryState:
repository.clear_https_credential()
return repository.refresh(allow_prompt=True)
self._start_git_task("Clearing rejected credential and signing in", clear_and_refresh)
def _finish_success(self, state: RepositoryState) -> None:
self.busy = False
self.state = state