jesseduffield.lazygit/pkg
Stefan Haller c8bc1928f2 Get the GitHub token from gh instead of resolving it in-process
go-gh reads gh's config file once per process and answers from that
snapshot for the rest of the process's life. gh rewrites the file
whenever the active account changes, and stores the active account's
token either in it or in the system keyring, depending on the account.
A lazygit that has been running for a while therefore consults a
snapshot that no longer describes reality: it either keeps using a
token for an account that is no longer active, or, when the snapshot
was taken while a keyring-backed account was active, finds no token at
all and silently stops showing pull requests until it is restarted.

Asking gh resolves the token afresh on every refresh, from whichever of
the environment, the keyring or the config file currently holds it.
go-gh's lookup stays behind as a fallback for setups without the gh
binary, where it still picks up GH_TOKEN and friends.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 19:13:06 +02:00
..
app Recognize a repo that has no work tree instead of bailing out 2026-08-08 11:15:01 +02:00
cheatsheet Render every key for a binding in the cheatsheet 2026-05-25 15:18:18 +02:00
commands Get the GitHub token from gh instead of resolving it in-process 2026-08-12 19:13:06 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Move Github PR cache out of state.yml into a separate file 2026-08-02 19:09:22 +02:00
constants Adapt links 2026-07-31 08:42:51 +02:00
env Remember how to get back to a repo we entered a submodule from 2026-08-08 11:15:01 +02:00
fakes Modernize all codes 2025-11-15 10:46:23 +01:00
gocui Give up waiting for the UI thread once the main loop has exited 2026-08-12 13:03:26 +02:00
gui Make RefreshHelper pay attention to the error returned from OnUIThreadAndWait 2026-08-12 13:03:26 +02:00
i18n Run the stash operations with a waiting status 2026-08-08 12:26:18 +02:00
integration Honor the conflict-marker-size gitattribute 2026-08-08 12:43:42 +02:00
jsonschema Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
logs Fix Windows linter errors 2026-06-16 16:21:13 +02:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Let OnUIThreadAndWait's error be about the wait, not about f 2026-08-12 11:04:53 +02:00
theme Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Make StringStack generic 2026-08-08 11:15:01 +02:00