From cc1e543ebcbff6f084541ed80430fcf446fabcf7 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 16 Jan 2026 10:04:40 +0100 Subject: [PATCH] git(core): include cwd and git output in pull_args error Show the working directory and captured git output when `git pull` fails via pull_args(). This makes debugging repository-specific failures (missing upstream, auth issues, detached HEAD, etc.) significantly easier, especially when pulling multiple repositories. https://chatgpt.com/share/6969ff2c-ed2c-800f-b506-5834b6b81141 --- src/pkgmgr/core/git/commands/pull_args.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pkgmgr/core/git/commands/pull_args.py b/src/pkgmgr/core/git/commands/pull_args.py index 2e679a9..8027f58 100644 --- a/src/pkgmgr/core/git/commands/pull_args.py +++ b/src/pkgmgr/core/git/commands/pull_args.py @@ -29,7 +29,11 @@ def pull_args( try: run(["pull", *extra], cwd=cwd, preview=preview) except GitRunError as exc: + details = getattr(exc, "output", None) or getattr(exc, "stderr", None) or "" raise GitPullArgsError( - f"Failed to run `git pull` with args={extra!r}.", + ( + f"Failed to run `git pull` with args={extra!r} " + f"in cwd={cwd!r}.\n{details}" + ).rstrip(), cwd=cwd, ) from exc